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

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.8, 2.8.1
    • Component/s: Appenders, Layouts
    • Labels:
      None
    • Environment:

      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

              • Assignee:
                garydgregory Gary Gregory
                Reporter:
                eldargab Eldar Gabdullin
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: