Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-383

[Pattern Layout] Customize level names by length

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.0-beta9
    • Layouts
    • None

    Description

      The level in a pattern layout can be defined as:

      %level{length=n}
      

      For example:

      %level{length=1}
      

      Which will give you log level names:

      • I for Info
      • W for Warning
      • D for Debug
      • and so on.

      If n is greater than a level name length, the length of the level name is used.

      Note that the level name computation is done when the pattern is created, thus having no impact on logging performance.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            ggregory Gary D. Gregory
            ggregory Gary D. Gregory
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment