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

[Pattern Layout] Customize level names by length

    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:
              garydgregory Gary Gregory
              Reporter:
              garydgregory Gary Gregory
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: