File tree Expand file tree Collapse file tree
examples/NetCore2/HostingExample Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ private static async Task Main()
1818 {
1919 var hostBuilder = new HostBuilder ( )
2020 . UseNLog ( )
21+ . ConfigureLogging ( builder => builder . SetMinimumLevel ( Microsoft . Extensions . Logging . LogLevel . Trace ) )
2122 . ConfigureServices ( ( hostContext , services ) => services . AddHostedService < ConsoleHostedService > ( ) ) ;
2223
2324 // Build and run the host in one go; .RCA is specialized for running it in a console.
@@ -53,8 +54,8 @@ public ConsoleHostedService(ILogger<ConsoleHostedService> logger)
5354 protected override async Task ExecuteAsync ( CancellationToken stoppingToken )
5455 {
5556 _logger . LogInformation ( "Hello from your hosted service thread!" ) ;
56- _logger . LogInformation ( "I may or may not return for a long time depending on what I do." ) ;
57- _logger . LogInformation ( "In this example, I return right away, but my host will continue to run until" ) ;
57+ _logger . LogTrace ( "I may or may not return for a long time depending on what I do." ) ;
58+ _logger . LogDebug ( "In this example, I return right away, but my host will continue to run until" ) ;
5859 _logger . LogInformation ( "its CancellationToken is Cancelled (SIGTERM(Ctrl-C) or a Lifetime Event )" ) ;
5960 await Task . CompletedTask ;
6061 }
You can’t perform that action at this time.
0 commit comments