C
C#3y ago
CrosRoad95

❔ Serilog

Let's say i have a following log: Logger.Information("You have earn {amount}{currency}", 10, "$") can i make a currency is only text formated and no label being created? i don't want useless labels be exported to for example seq ping me if you know
6 Replies
Anton
Anton3y ago
Just format it in place I guess
string str = string.Format(same_thing);
Logger.Information(str);
string str = string.Format(same_thing);
Logger.Information(str);
Of course, this would always allocate the string, whether the message would be printed or not Ah nevermind
Anton
Anton3y ago
GitHub
Structured Data · serilog/serilog Wiki
Simple .NET logging with fully-structured events. Contribute to serilog/serilog development by creating an account on GitHub.
Anton
Anton3y ago
It's simpler
CrosRoad95
CrosRoad95OP3y ago
so i should make {@currency}
Jayy
Jayy3y ago
jsut use string interpolation then theres no reason to use serilog if you dont want structured logs lol
Accord
Accord3y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.

Did you find this page helpful?