@@ -49,7 +49,7 @@ public class Program
4949```csharp
5050 public static IWebHost BuildWebHost (string [] args ) =>
5151 WebHost .CreateDefaultBuilder (args )
52- .UseStartup <Startup >()
52+ .UseStartup <Startup >()
5353 .UseSerilog () // <-- Add this line
5454 .Build ();
5555}
@@ -66,12 +66,12 @@ That's it! With the level bumped up a little you will see log output resembling:
6666
6767```
6868[22:14:44.646 DBG] RouteCollection.RouteAsync
69- Routes:
70- Microsoft.AspNet.Mvc.Routing.AttributeRoute
71- {controller=Home}/{action=Index}/{id?}
72- Handled? True
69+ Routes:
70+ Microsoft.AspNet.Mvc.Routing.AttributeRoute
71+ {controller=Home}/{action=Index}/{id?}
72+ Handled? True
7373[22:14:44.647 DBG] RouterMiddleware.Invoke
74- Handled? True
74+ Handled? True
7575[22:14:45.706 DBG] /lib/jquery/jquery.js not modified
7676[22:14:45.706 DBG] /css/site.css not modified
7777[22:14:45.741 DBG] Handled. Status code: 304 File: /css/site.css
@@ -162,12 +162,12 @@ Then add a file sink to your `LoggerConfiguration`, taking care to set the `shar
162162 .MinimumLevel .Override (" Microsoft" , LogEventLevel .Information )
163163 .Enrich .FromLogContext ()
164164 .WriteTo .Console ()
165- // Add this line:
166- .WriteTo .File (
167- @" D:\home\LogFiles\Application\myapp.txt" ,
168- fileSizeLimitBytes : 1_ 000_ 000 ,
169- rollOnFileSizeLimit : true ,
170- shared : true ,
171- flushToDiskInterval : TimeSpan .FromSeconds (1 ))
165+ // Add this line:
166+ .WriteTo .File (
167+ @" D:\home\LogFiles\Application\myapp.txt" ,
168+ fileSizeLimitBytes : 1_ 000_ 000 ,
169+ rollOnFileSizeLimit : true ,
170+ shared : true ,
171+ flushToDiskInterval : TimeSpan .FromSeconds (1 ))
172172 .CreateLogger ();
173173```
0 commit comments