File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
src/NHibernate.Example.Web Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change 1414 <PackageReference Include =" Microsoft.AspNetCore.Mvc" Version =" 2.0.0" />
1515 <PackageReference Include =" Microsoft.AspNetCore.Mvc.Razor.ViewCompilation" Version =" 2.0.0" PrivateAssets =" All" />
1616 <PackageReference Include =" Microsoft.AspNetCore.StaticFiles" Version =" 2.0.0" />
17+ <PackageReference Include =" Serilog.AspNetCore" Version =" 2.0.0" />
18+ <PackageReference Include =" Serilog.Sinks.Console" Version =" 3.1.0" />
1719 </ItemGroup >
1820
1921 <ItemGroup >
Original file line number Diff line number Diff line change 77using Microsoft . AspNetCore . Hosting ;
88using Microsoft . Extensions . Configuration ;
99using Microsoft . Extensions . Logging ;
10+ using Serilog ;
11+ using Serilog . Events ;
1012
1113namespace NHibernate . Example . Web
1214{
1315 public class Program
1416 {
1517 public static void Main ( string [ ] args )
1618 {
19+ Log . Logger = new LoggerConfiguration ( )
20+ . MinimumLevel . Debug ( )
21+ . MinimumLevel . Override ( "Microsoft" , LogEventLevel . Information )
22+ . Enrich . FromLogContext ( )
23+ . WriteTo . Console ( )
24+ . CreateLogger ( ) ;
25+
1726 BuildWebHost ( args ) . Run ( ) ;
1827 }
1928
2029 public static IWebHost BuildWebHost ( string [ ] args ) =>
2130 WebHost . CreateDefaultBuilder ( args )
2231 . UseStartup < Startup > ( )
32+ . UseSerilog ( )
2333 . Build ( ) ;
2434 }
2535}
You can’t perform that action at this time.
0 commit comments