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 14
14
<PackageReference Include =" Microsoft.AspNetCore.Mvc" Version =" 2.0.0" />
15
15
<PackageReference Include =" Microsoft.AspNetCore.Mvc.Razor.ViewCompilation" Version =" 2.0.0" PrivateAssets =" All" />
16
16
<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" />
17
19
</ItemGroup >
18
20
19
21
<ItemGroup >
Original file line number Diff line number Diff line change 7
7
using Microsoft . AspNetCore . Hosting ;
8
8
using Microsoft . Extensions . Configuration ;
9
9
using Microsoft . Extensions . Logging ;
10
+ using Serilog ;
11
+ using Serilog . Events ;
10
12
11
13
namespace NHibernate . Example . Web
12
14
{
13
15
public class Program
14
16
{
15
17
public static void Main ( string [ ] args )
16
18
{
19
+ Log . Logger = new LoggerConfiguration ( )
20
+ . MinimumLevel . Debug ( )
21
+ . MinimumLevel . Override ( "Microsoft" , LogEventLevel . Information )
22
+ . Enrich . FromLogContext ( )
23
+ . WriteTo . Console ( )
24
+ . CreateLogger ( ) ;
25
+
17
26
BuildWebHost ( args ) . Run ( ) ;
18
27
}
19
28
20
29
public static IWebHost BuildWebHost ( string [ ] args ) =>
21
30
WebHost . CreateDefaultBuilder ( args )
22
31
. UseStartup < Startup > ( )
32
+ . UseSerilog ( )
23
33
. Build ( ) ;
24
34
}
25
35
}
You can’t perform that action at this time.
0 commit comments