Skip to content

Option to strip newlines from layout-renderers #86

@ghost

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.

Moved from http://nlog.codeplex.com/workitem/6531

Comments:
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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions