1

Closed

Option to strip newlines from layout-renderers

description

I find it quite hard to read (as in, visually parse) log-files where the events span more than one line (because, for example, they include a stacktrace or a multi-line message).
 
It would be great if there were an option to strip newlines from layout-renderers and instead render them as either nothing or some other character.
Closed Oct 7, 2012 at 4:30 PM by Xharze
Moved to https://github.com/NLog/NLog/issues/86

comments

jberezanski wrote Jun 27, 2012 at 2:38 PM

It is very simple to implement as a wrapper layout renderer, possibly decorated with AmbientPropertyAttribute. See https://github.com/jkowalski/NLog/blob/master/src/NLog/LayoutRenderers/Wrappers/TrimWhiteSpaceLayoutRendererWrapper.cs for an example.