Skip to content

Level casing when length set to 5 and more #76

@JethroCZ

Description

@JethroCZ

A few questions before you begin:

Is this an issue related to the Serilog core project or one of the sinks or community projects. This issue list is intended for Serilog core issues. If this issue relates to a sink or related project, please log on the related repository. Please use Gitter chat and Stack Overflow for discussions and questons.

It is related to this sink (console).

Does this issue relate to a new feature or an existing bug?

  • Bug
  • New Feature

What version of Serilog Console Sink is affected by this issue? Please list the related NuGet package.
NuGet version 3.1.1.

What is the target framework and operating system affected by this issue? Please see target frameworks & net standard matrix.

  • netCore 2.0
  • netCore 1.0
  • 4.7
  • 4.6.x
  • 4.5.x

Please describe the current behaviour you are experiencing?
When I set "Level" in "outputTemplate" argument to five letter or more, it doesnt format it to provided case. Setting "{Level:u5}" and "{Level:w5}" always format all levels in CamelCase: "Debug", "Infor", etc.

Please describe the expected behaviour if the ?
In case of "{Level:u5}" it should be all upper case and in case of "{Level:w5}" it should be all lower case.

If the current behavior is a bug, please provide the steps to reproduce the issue and if possible a minimal demo of the problem
In JSON configuration

"WriteTo": [
      {
        "Name": "Console",
        "Args": {
          "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss,fff} [{ThreadId}] {Level:u5} [{ndc:u8}] usr:{LoggedUser:u10} {Message:lj}{NewLine}{Exception}"
        }
      }
]

NOTE: A small code sample goes a long way in expediting bug fixes or illustrating an enhancement you are proposing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions