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

Misleading documentation of PatternLayout

    XMLWordPrintableJSON

Details

    • Documentation
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.1
    • 2.4.1
    • Layouts
    • platform independently

    Description

      The documentation for the PatternLayout on the Website https://logging.apache.org/log4j/log4j-2.1/manual/layouts.html#PatternLayout contains the following wrong statement:

      The character set to use when converting the syslog String to a byte array. The String must be a valid Charset. If not specified, the default system Charset will be used.

      The Java-Doc states no information:

      [...]
      @param charset The character set.
      [...]
      

      The implementation look like the following:

      @PluginAttribute(value = "charset", defaultString = "UTF-8") final Charset charset,
      

      The fallback default charset is not the system's charset. It's always UTF-8

      That difference leads up to an encoding issue when an instance writes messages to a logger with system's charset different from UTF-8.


      Tasks:
      inform persons in power of JavaDoc and WebsiteDoc
      Change the documentation on website
      Add more information to JavaDoc
      review by responsible persons

      Attachments

        Activity

          People

            Unassigned Unassigned
            Jansen Jan Kursawe
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified