✅ Console Logging - No New Lines
Not sure if this is M.E.L or Serilog or Microsoft Terminal doing this
Developing a service as a console app as one does, but when logging to the console, new lines only appear after stack traces. Everything else always appears on the same line.
The
{Newline}
piece in my format doesn't seem to be working either. Exception messages are smashed up against the actual message.
I am running on Windows with NET7 and the latest version of all relevant packages.
Anyone run into this before? Google hasn't6 Replies
Log format:
[{Timestamp:HH:mm:ss}] {Level:u3} [{SourceContext}] {Message:lj}{Newline}{Exception}
Can you provide a minimal repro?
silly question, is
{NewLine}
case sensitive? that's specifically how i spell it in my serilog configThat fixed it!
I didn't notice the typo. Strange that it removed all newlines rather than just the ones between messages and exceptions
But now it's printing normally
i suspect it's because that is the new line between messages and exceptions have a trailing newline, which would explain why you only got them after stack traces
That's a very good point