feat(infra): Docker-compose configuration and environment-specific security guards for Beta deployment to Test environment #56
@@ -2,116 +2,128 @@
|
||||
@inject ILogger<SerilogDemo> Logger
|
||||
@inject IJSRuntime JSRuntime
|
||||
|
||||
#if DEBUG
|
||||
<div class="serilog-demo-container">
|
||||
<div class="header-card glass-panel">
|
||||
<div class="header-content">
|
||||
<NexusIcon Name="cpu" Size="36" Class="header-icon" />
|
||||
<div class="header-text">
|
||||
<h1>Serilog Logging Infrastructure</h1>
|
||||
<p class="subtitle">Production-grade diagnostic pipeline for unified native & web logs</p>
|
||||
@if (_isDebug)
|
||||
{
|
||||
<div class="serilog-demo-container">
|
||||
<div class="header-card glass-panel">
|
||||
<div class="header-content">
|
||||
<NexusIcon Name="cpu" Size="36" Class="header-icon" />
|
||||
<div class="header-text">
|
||||
<h1>Serilog Logging Infrastructure</h1>
|
||||
<p class="subtitle">Production-grade diagnostic pipeline for unified native & web logs</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="status-badge">
|
||||
<span class="status-dot green"></span>
|
||||
<span class="status-text">Pipeline Active</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="status-badge">
|
||||
<span class="status-dot green"></span>
|
||||
<span class="status-text">Pipeline Active</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="demo-grid">
|
||||
<!-- Native .NET Logging Panel -->
|
||||
<div class="control-card glass-panel">
|
||||
<div class="demo-grid">
|
||||
<!-- Native .NET Logging Panel -->
|
||||
<div class="control-card glass-panel">
|
||||
<div class="card-header">
|
||||
<NexusIcon Name="terminal" Size="20" Class="card-icon" />
|
||||
<h2>Native .NET Logs (C#)</h2>
|
||||
</div>
|
||||
<p class="card-desc">Trigger structured C# logs using Dependency Injected ILogger.</p>
|
||||
<div class="btn-group">
|
||||
<button class="btn btn-info" @onclick="LogInfo">
|
||||
<NexusIcon Name="info" Size="16" />
|
||||
Log Info
|
||||
</button>
|
||||
<button class="btn btn-warning" @onclick="LogWarning">
|
||||
<NexusIcon Name="alert-triangle" Size="16" />
|
||||
Log Warning
|
||||
</button>
|
||||
<button class="btn btn-error" @onclick="LogError">
|
||||
<NexusIcon Name="x-circle" Size="16" />
|
||||
Log Error Exception
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Blazor / JS Interop Bridge Panel -->
|
||||
<div class="control-card glass-panel">
|
||||
<div class="card-header">
|
||||
<NexusIcon Name="globe" Size="20" Class="card-icon js-icon" />
|
||||
<h2>Blazor / JS WebView Logs</h2>
|
||||
</div>
|
||||
<p class="card-desc">Trigger logs from JavaScript to verify the interop error capture bridge.</p>
|
||||
<div class="btn-group">
|
||||
<button class="btn btn-js-info" @onclick="TriggerJsLog">
|
||||
<NexusIcon Name="message-square" Size="16" />
|
||||
Trigger console.log()
|
||||
</button>
|
||||
<button class="btn btn-js-error" @onclick="TriggerJsException">
|
||||
<NexusIcon Name="zap" Size="16" />
|
||||
Trigger JS Exception
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Active Log Config Panel -->
|
||||
<div class="config-card glass-panel">
|
||||
<div class="card-header">
|
||||
<NexusIcon Name="terminal" Size="20" Class="card-icon" />
|
||||
<h2>Native .NET Logs (C#)</h2>
|
||||
<NexusIcon Name="settings" Size="20" Class="card-icon" />
|
||||
<h2>Pipeline Diagnostics</h2>
|
||||
</div>
|
||||
<p class="card-desc">Trigger structured C# logs using Dependency Injected ILogger.</p>
|
||||
<div class="btn-group">
|
||||
<button class="btn btn-info" @onclick="LogInfo">
|
||||
<NexusIcon Name="info" Size="16" />
|
||||
Log Info
|
||||
</button>
|
||||
<button class="btn btn-warning" @onclick="LogWarning">
|
||||
<NexusIcon Name="alert-triangle" Size="16" />
|
||||
Log Warning
|
||||
</button>
|
||||
<button class="btn btn-error" @onclick="LogError">
|
||||
<NexusIcon Name="x-circle" Size="16" />
|
||||
Log Error Exception
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Blazor / JS Interop Bridge Panel -->
|
||||
<div class="control-card glass-panel">
|
||||
<div class="card-header">
|
||||
<NexusIcon Name="globe" Size="20" Class="card-icon js-icon" />
|
||||
<h2>Blazor / JS WebView Logs</h2>
|
||||
</div>
|
||||
<p class="card-desc">Trigger logs from JavaScript to verify the interop error capture bridge.</p>
|
||||
<div class="btn-group">
|
||||
<button class="btn btn-js-info" @onclick="TriggerJsLog">
|
||||
<NexusIcon Name="message-square" Size="16" />
|
||||
Trigger console.log()
|
||||
</button>
|
||||
<button class="btn btn-js-error" @onclick="TriggerJsException">
|
||||
<NexusIcon Name="zap" Size="16" />
|
||||
Trigger JS Exception
|
||||
</button>
|
||||
<div class="config-grid">
|
||||
<div class="config-item">
|
||||
<span class="label">Rolling Daily File Sandbox Path</span>
|
||||
<span class="value code-value">AppDataDirectory/logs/log-*.txt</span>
|
||||
</div>
|
||||
<div class="config-item">
|
||||
<span class="label">Active Configuration Provider</span>
|
||||
<span class="value">Serilog.Settings.Configuration (appsettings.json)</span>
|
||||
</div>
|
||||
<div class="config-item">
|
||||
<span class="label">Native Apple Console Sink</span>
|
||||
<span class="value">Serilog.Sinks.Debug (conditional compilation)</span>
|
||||
</div>
|
||||
<div class="config-item">
|
||||
<span class="label">Native Android Logcat Sink</span>
|
||||
<span class="value">AndroidLogcatSink (direct JNI bindings)</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Active Log Config Panel -->
|
||||
<div class="config-card glass-panel">
|
||||
<div class="card-header">
|
||||
<NexusIcon Name="settings" Size="20" Class="card-icon" />
|
||||
<h2>Pipeline Diagnostics</h2>
|
||||
</div>
|
||||
<div class="config-grid">
|
||||
<div class="config-item">
|
||||
<span class="label">Rolling Daily File Sandbox Path</span>
|
||||
<span class="value code-value">AppDataDirectory/logs/log-*.txt</span>
|
||||
</div>
|
||||
<div class="config-item">
|
||||
<span class="label">Active Configuration Provider</span>
|
||||
<span class="value">Serilog.Settings.Configuration (appsettings.json)</span>
|
||||
</div>
|
||||
<div class="config-item">
|
||||
<span class="label">Native Apple Console Sink</span>
|
||||
<span class="value">Serilog.Sinks.Debug (conditional compilation)</span>
|
||||
</div>
|
||||
<div class="config-item">
|
||||
<span class="label">Native Android Logcat Sink</span>
|
||||
<span class="value">AndroidLogcatSink (direct JNI bindings)</span>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="serilog-demo-container">
|
||||
<div class="glass-panel" style="text-align: center; padding: 3rem;">
|
||||
<h2>Diagnostics Unavailable</h2>
|
||||
<p>This page is only available in DEBUG builds.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
#else
|
||||
<div class="serilog-demo-container">
|
||||
<div class="glass-panel" style="text-align: center; padding: 3rem;">
|
||||
<h2>Diagnostics Unavailable</h2>
|
||||
<p>This page is only available in DEBUG builds.</p>
|
||||
</div>
|
||||
</div>
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
@code {
|
||||
#if DEBUG
|
||||
private readonly bool _isDebug = true;
|
||||
#else
|
||||
private readonly bool _isDebug = false;
|
||||
#endif
|
||||
|
||||
private void LogInfo()
|
||||
{
|
||||
#if DEBUG
|
||||
Logger.LogInformation("Structured native log triggered by user from SerilogDemo. Button: LogInfo");
|
||||
#endif
|
||||
}
|
||||
|
||||
private void LogWarning()
|
||||
{
|
||||
#if DEBUG
|
||||
Logger.LogWarning("Potential warning log triggered from Blazor razor component at {Time}", DateTime.UtcNow);
|
||||
#endif
|
||||
}
|
||||
|
||||
private void LogError()
|
||||
{
|
||||
#if DEBUG
|
||||
try
|
||||
{
|
||||
throw new InvalidOperationException("Simulated native C# operation exception triggered in Diagnostic dashboard.");
|
||||
@@ -120,16 +132,22 @@
|
||||
{
|
||||
Logger.LogError(ex, "Captured exception successfully in native Serilog pipeline!");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
private async Task TriggerJsLog()
|
||||
{
|
||||
#if DEBUG
|
||||
await JSRuntime.InvokeVoidAsync("console.log", "Intercepted JS console statement from Blazor WebView interop trigger!");
|
||||
#endif
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
private async Task TriggerJsException()
|
||||
{
|
||||
#if DEBUG
|
||||
await JSRuntime.InvokeVoidAsync("eval", "throw new Error('Simulated runtime JS Exception triggered from Blazor UI button click!');");
|
||||
}
|
||||
#endif
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user