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

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0-beta9
    • Component/s: Layouts
    • Labels:
      None
    • Environment:

      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

            People

            • Assignee:
              ggregory Gary D. Gregory
              Reporter:
              ggregory Gary D. Gregory

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment