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

Console Appender does not pick up Oracle Java 8's sun.stdout.encoding and sun.stderr.encoding

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.8, 2.8.1
    • Appenders, Layouts
    • None
    • Windows

    Description

      The Oracle Java 8 platform supports two system properties to configure the System console: sun.stdout.encoding and sun.stderr.encoding.


      Default log4j configuration prints to console using platform's default encoding, however that's not what standard windows console expects.

      I.e.

      System.out.println("Поехали"); // works just fine
      System.out.write("Поехали!\n".getBytes(Charset.defaultCharset())); // characters are messed up
      log.info("Поехали"); // messed up in the same way
      

      This happens not just on one machine, but on all Windows desktops and servers in our organization.

      Can we have out of the box Layout/Appender which prints directly to System.out/err?

      Attachments

        Issue Links

          Activity

            People

              ggregory Gary D. Gregory
              eldargab Eldar Gabdullin
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: