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

Ansi escape code for highlight is generated wrong

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.14.1
    • 2.18.0
    • None
    • None

    Description

      This is a test pattern layout:

       <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} %highlight{[%level]}{FATAL=red bright, ERROR=red bright, WARN=yellow bright, INFO=magenta bright, DEBUG=green, TRACE=blue bright} [%t] %logger{36} - %msg%n" disableAnsi="false"/>
      

      As you see for TRACE level is `blue bright`. However, this is a generated code:
      [TRACE] . As you see we have SGR function with two parameters: 34 is color and 1 is bold.

      For example linux terminal will render it this way:

      We see, that it is not `bright blue` but `bold blue`. At the same time in manual they speak about different colors:

      And if we want bright blue, generated escape code should be `[TRACE]` - see the link to SGR function I provided.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Pavel_K Pavel_K
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: