Skip to content

Commit 1aaa3e6

Browse files
committed
fix: don't break logging params on original msg
1 parent eef2987 commit 1aaa3e6

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

samples/Sentry.Samples.AspNetCore.Mvc/Controllers/HomeController.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Collections.Generic;
23
using System.Diagnostics;
34
using System.Threading.Tasks;
45
using 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();

src/Sentry.Extensions.Logging/SentryLogger.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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)

0 commit comments

Comments
 (0)