Log views
Drop-in Blazor components that render Application Insights data fetched via IApplicationInsightsService. The same components power Quilt4Net Server's /monitor/log and /developer/log pages.
Minimum
@using Quilt4Net.Toolkit.Blazor.Features.Log
<LogView />
Renders the Search / Summary / Measure / Count tabs against the AI workspace configured by AddQuilt4NetApplicationInsightsClient. Detail and Summary drill-downs open in a Radzen dialog.
Supplying configurations
LogView queries one workspace at a time. Point it at one, in precedence order:
| Source | Use when |
|---|---|
Context |
A single workspace (or the locally configured one). |
Configs |
You already hold an explicit set (e.g. a team's). LogView renders a dropdown to pick one when more than one is supplied. |
| DI selector | You registered AddQuilt4NetBlazorApplicationInsightsClientRemote; the built-in dropdown is driven by it. |
Configs is an IReadOnlyList<ApplicationInsightsConfigurationResponse>, so a host that already has the team's workspaces in hand can render LogView directly instead of wrapping it in a custom picker:
<LogView Configs="@_workspaces" FilterStorageScope="@team.Key" />
Precedence: Context > selected Configs entry > DI selector.
Dedicated detail / summary pages
@page "/log"
<LogView Tab="@Tab" DetailPath="/log/detail" SummaryPath="/log/summary" />
@code {
[Parameter, SupplyParameterFromQuery] public string Tab { get; set; }
}
@page "/log/detail/{Id}"
<LogDetailView Id="@Id" Params="@P" SummaryPath="/log/summary" />
@code {
[Parameter] public string Id { get; set; }
[Parameter, SupplyParameterFromQuery] public string P { get; set; }
}
?tab=... is honoured (and updated) by LogView as the user switches tabs ā deep linking and browser back/forward work out of the box.
Application alias rendering
Real-world AI data often spreads one logical app across multiple cloud_RoleName values (e.g. MyApp.Server + MyApp.Server.Client for a Blazor Server + WASM combo). Pass an ApplicationAliasMap to render every Application cell as the logical name with the raw value on hover:
<LogView ApplicationAliasMap="@_aliasMap" />
@code {
private readonly Dictionary<string, string> _aliasMap = new(StringComparer.OrdinalIgnoreCase)
{
["MyApp.Server"] = "myapp-web",
["MyApp.Server.Client"] = "myapp-web"
};
}
For static maps shared across the whole app, set ApplicationInsightsOptions.ApplicationAlias once at startup and the toolkit picks it up ā no per-page wiring needed.
Filter bar (Source / Level / Application / Environment)
The Search and Summary tabs each render a <LogFilterBar> above the grid ā four RadzenSelectBar Multi="true" rows. Source and Level options come from the enums; Application and Environment options are populated from the loaded data's distinct values (with alias resolution applied to applications). Filtering replaces Radzen's per-column filter inputs.
FilterStorageScope enables browser-localStorage persistence keyed under Quilt4Net.Log.Filters.{scope}.{tab}:
<LogView FilterStorageScope="@team.Key" />
The user's filter selection on each tab survives reloads and is isolated per scope value.
CorrelationId column on Search
The Search tab renders a 140 px Correlation column showing the first 8 chars of the GUID with a hover tooltip and a copy button:
1a2b3c4d⦠š
Click the preview ā Search re-runs scoped to that correlation id. LogItem.CorrelationId is populated automatically when your apps emit it as a structured property; Quilt4Net.Toolkit.Api's CorrelationIdMiddleware does this via a logging scope (see Telemetry identity & correlation).
Stack Trace tab + Resharper-friendly file:line
The Detail view's Stack Trace sub-tab parses AppExceptions.Details[].parsedStack into a grid:
| # | Assembly | Method | File | Line | Copy |
|---|---|---|---|---|---|
| 0 | MyApp.Server | MyApp.Foo.Bar |
UserService.cs | 24 | š |
The "Show frames without file/line" toggle hides system / framework frames by default. The per-row CopyButton produces a :line N-suffixed path. Configure SourcePathRoots to shorten paths so an IDE can find the file:
<LogView SourcePathRoots="@(new[] { "MyApp.Server" })" />
A frame whose fileName is D:\a\1\s\MyApp.Server\Features\Team\UserService.cs line 24 ā clipboard text \Features\Team\UserService.cs:line 24. Paste-ready into Rider's "Find file" prompt.
The Stack Trace tab is exception-only; trace and request rows show a friendly "no parsed stack trace available" alert instead of an empty grid.
Test tab (developer-only)
<LogView ShowTestTab="true" />
Adds a tab that triggers traces and exceptions at every LogLevel via ILogger, plus an uncaught throw caught by Tharga.Blazor.CustomErrorBoundary so the correlation guid surfaces in the recovery banner and in customDimensions["CorrelationId"]. Off by default so external apps don't accidentally expose log-injection controls.
Where next
- Telemetry identity & correlation ā how the data shown by these components reaches AI in the first place.
- API reference for the new types:
xref:Quilt4Net.Toolkit.Features.ApplicationInsights.LogItem.CorrelationId,xref:Quilt4Net.Toolkit.Features.ApplicationInsights.StackFrameParser.