Log4j 2
  1. Log4j 2
  2. LOG4J2-383

[Pattern Layout] Customize level names by length

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major 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.

        Activity

        Matt Sicker made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Gary Gregory made changes -
        Summary [Pattern Layout] Customize level name by length [Pattern Layout] Customize level names by length
        Gary Gregory made changes -
        Issue Type Bug [ 1 ] Improvement [ 4 ]
        Gary Gregory made changes -
        Field Original Value New Value
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Gary Gregory created issue -

          People

          • Assignee:
            Gary Gregory
            Reporter:
            Gary Gregory
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development