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

Cannot see or copy all of certain JAnsi exception messages on Windows due to NUL characters

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.11.0, 3.0.0
    • Component/s: Appenders
    • Labels:
      None

      Description

      Using JAnsi in some cases (like in Eclipse) can cause Log4j's status logger to log the following:

      2018-02-08 20:57:05,256 main WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream due to java.io.IOException: Could not get the screen info: T h e   h a n d l e   i s   i n v a l i d .
      

      The problem is that the spaces in the string "T h e h a n d l e i s i n v a l i d ." are NUL (0) characters. If you copy a whole console, then when you paste, the text you get will stop at the first NUL (0).

      This fix simply replaces NUL characters with SPACEs in the one place where we try to initialize JAnsi.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: