C
C#17mo ago
Foxtrek_64

✅ 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't
6 Replies
Foxtrek_64
Foxtrek_64OP17mo ago
Log format: [{Timestamp:HH:mm:ss}] {Level:u3} [{SourceContext}] {Message:lj}{Newline}{Exception}
mtreit
mtreit17mo ago
Can you provide a minimal repro?
Jimmacle
Jimmacle17mo ago
silly question, is {NewLine} case sensitive? that's specifically how i spell it in my serilog config
Foxtrek_64
Foxtrek_64OP17mo ago
That 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
Jimmacle
Jimmacle17mo ago
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
Foxtrek_64
Foxtrek_64OP17mo ago
That's a very good point
Want results from more Discord servers?
Add your server