File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 11using Blazored . LocalStorage ;
22using GithubStarSearch ;
3- using MudBlazor . Services ;
43using GithubStarSearch . Components ;
54using GithubStarSearch . Searching ;
5+ using MudBlazor . Services ;
6+ using Serilog ;
67
78var builder = WebApplication . CreateBuilder ( args ) ;
89
10+ // Add serilog
11+ builder . Services . AddSerilog ( x => x
12+ . Enrich . FromLogContext ( )
13+ . WriteTo . Console (
14+ outputTemplate : "[{Timestamp:HH:mm:ss} {Level:u3}] {SourceContext} {Message:lj}{NewLine}{Exception}" ) ) ;
15+
916// Add MudBlazor services
1017builder . Services . AddMudServices ( ) ;
1118
2027
2128var app = builder . Build ( ) ;
2229
30+ app . UseSerilogRequestLogging ( ) ;
31+
2332// Configure the HTTP request pipeline.
2433if ( ! app . Environment . IsDevelopment ( ) )
2534{
3645app . MapRazorComponents < App > ( )
3746 . AddInteractiveServerRenderMode ( ) ;
3847
39- app . Run ( ) ;
48+ app . Run ( ) ;
Original file line number Diff line number Diff line change 1616 <PackageReference Include =" MudBlazor" Version =" 7.*" />
1717 <PackageReference Include =" Octokit" Version =" 14.0.0" />
1818 <PackageReference Include =" MeiliSearch" Version =" 0.15.5" />
19+ <PackageReference Include =" Serilog.AspNetCore" Version =" 9.0.0" />
1920 </ItemGroup >
2021</Project >
You can’t perform that action at this time.
0 commit comments