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

    Details

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

      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

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: