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

PatternLayout option to not output ANSI escape codes if no Console is available

    XMLWordPrintableJSON

Details

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

    Description

      In some environments, like the Eclipse IDE, logging to the Java Console is redirected to the GUI. In this context, ANSI escape codes mean nothing and show up as "garbage" on the screen.

      This condition can be detected, if java.lang.System.console() returns null, like it does in Eclipse, then we should optionally not output ANSI codes.

      It would be best to provide this as an option such that ANSI codes could still be written to a file for later viewing on the console.

      Attachments

        1. LOG4J2-413.diff
          66 kB
          Gary D. Gregory

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: