serilog / serilog-sinks-xamarin

A Serilog sink that writes events to Xamarin mobile targets
Apache License 2.0
55 stars 18 forks source link

newline not working in DefaultAndroidLogOutputTemplate #31

Closed clnorris closed 4 months ago

clnorris commented 1 year ago

This bug is in the nitpick category. Most recently observed in Serial.Sinks.Xamarin 1.0.0.

In src/Serilog.Sinks.Xamarin/Sinks/Xamarin/android/LoggerConfigurationXamarinExtensions.cs, the default output template is: const string DefaultAndroidLogOutputTemplate = "[{Level}] {Message:l{NewLine:l}{Exception:l}";

The above does not produce a newline between Message and Exception, so the message and exception are jammed together.

This change produces the intended effect, where a newline precedes the exception: "[{Level}] {Message:l}{NewLine}{Exception:l}"

I can pass my fix via outputTemplate in AndroidLog(), but wondering if the default could be fixed.

nblumhardt commented 4 months ago

Thanks for this; in light of Xamarin being EOL'd, no further work is planned here, so I'm closing open issues in preparation for archiving it in the near future.