Skip to content

Somehow differentiating between TRACE and DEBUG levels #33

Description

@joanbarros

Hello, I have a proposal.

I've found myself needing to differentiate between TRACE and DEBUG log leves. I know Syslog considers/maps these two into Severity 7 and since as per the Syslog standard we are locked in a 0-7 range for the severity level, I was thinking...

Could we have this layout print a levelName property so we can differentiate between DEBUG and TRACE coming from NLog without messing around and potentially stepping outside of the Syslog standard? This of course could be set up to be optional and enabled by a configuration parameter just in case this field is not desired in the output.

Is this issue also affecting anyone else, or just me?

I wanted to propose it first, but I can implement this and submit a PR if you'd like.

Proposal

The Syslog log levels Would map as they currently do:

Log Level Syslog Mapping
Fatal 2
Error 3
Warn 4
Info 6
Debug 7
Trace 7

And then we'll have another property added called levelName which will contain the log levels by name.

Log Level String in the levelName field
Fatal "Fatal"
Error "Error"
Warn "Warn"
Info "Info"
Debug "Debug"
Trace "Trace"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions