Created
February 24, 2023 08:08
-
-
Save gubser/fa1004a5c3b677b209d92ddb3f1280c0 to your computer and use it in GitHub Desktop.
Serilog Expression that truncates exception stack trace to 10'000 chars
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var formatter = new ExpressionTemplate("{ {@t, @m, @r, @l: if @l = 'Information' then undefined() else @l, @x: if Length(@x) > 10000 then Concat(Substring(@x, 0, 9997), '...') else @x, ..@p} }\n") | |
LoggerConfiguration().WriteTo.Console(formatter) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment