File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
samples/Sentry.Samples.AspNetCore.Mvc/Controllers
src/Sentry.Extensions.Logging Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 11using System ;
2+ using System . Collections . Generic ;
23using System . Diagnostics ;
34using System . Threading . Tasks ;
45using Microsoft . AspNetCore . Mvc ;
@@ -62,7 +63,10 @@ public IActionResult About(string who = null)
6263 {
6364 // Exemplifies using the logger to raise a warning which will be sent as an event because MinimumEventLevel was configured to Warning
6465 // ALso, the stack trace of this location will be sent (even though there was no exception) because of the configuration AttachStackTrace
65- _logger . LogWarning ( "A /About 'null' was requested." ) ;
66+ _logger . LogWarning ( "A {route} '{value}' was requested." ,
67+ // example structured logging where keys (in the template above) go as tag keys and values below:
68+ "/about" ,
69+ "null" ) ;
6670 }
6771
6872 return View ( ) ;
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ public void Log<TState>(
7676 Formatted = message ,
7777 Message = template
7878 } ;
79- break ;
79+ continue ;
8080 }
8181
8282 if ( property . Value is string tagValue )
You can’t perform that action at this time.
0 commit comments