C
C#12mo 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_6412mo ago
Log format: [{Timestamp:HH:mm:ss}] {Level:u3} [{SourceContext}] {Message:lj}{Newline}{Exception}
mtreit
mtreit12mo ago
Can you provide a minimal repro?
Jimmacle
Jimmacle12mo ago
silly question, is {NewLine} case sensitive? that's specifically how i spell it in my serilog config
Foxtrek_64
Foxtrek_6412mo 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
Jimmacle12mo 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_6412mo ago
That's a very good point
Want results from more Discord servers?
Add your server
More Posts
❔ problem loading json into dynamic objectI have a problem loading a json file into a dynamic object in c#. My problem is that some parameters❔ ConfigureAwait(false) (IntelliCode Suggestion)Can someone help me to understand why IntelliCode is suggesting ConfigureAwait(false) at line 16 `aw✅ Class as a field?Suppose I have Class1, Class2, and Class3. Class2 is just a container of information. At runtime I w❔ Lazily evaluating Dictionary in update loop with good performance## Situation I have an update loop which receives some data which is Dictionary-like. Due to a versi❔ Hello everyone, I'm creating an application with ASP.NET Core,Hello everyone, I'm creating an application with ASP.NET Core, I used to insert images by typing the❔ App resource files conventionWhen your app depends on files you read from disk, what's the convention for where to store them? Fo❔ NSubstitute on IEnumerableHey - I'm trying to "freeze" an `IEnumerable<>` and return a mocked enumerator However, when doinmg❔ how do i include a range of numbers into a reply like 1-1000 for my thingstring correct = "well done. "; string wrong = "nope.try again. "; Console.WriteLine("Hello."); ❔ Xamarin.Forms Android App problem using Application.Context.StartActivity(intent)Hi, in short, I created a super small Xamarin.Forms Android App. All I need is just to press a butto❔ How can I test a custom IValueResolver in AutoMapper 12?With the latest release of AutoMapper,the public constructor in the ResolutionContext class has been