Log4cxx
  1. Log4cxx
  2. LOGCXX-60

XML layout can be mismatched with document encoding

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.9.7
    • Fix Version/s: 0.10.0
    • Component/s: Layout
    • Labels:
      None

      Description

      The XMLLayout acts independently of the document encoding and a mixmatch can easily result in invalid files. To prevent the issue, it would be beneficial if all characters greater than 0x7F be represented using character entities.

      In addition, the current XMLLayout would appear to not successfully handle logger names and other fields that contain special characters like <, >, ", etc. I believe that these same weaknesses affect log4j.

        Issue Links

          Activity

          Curt Arnold created issue -
          Curt Arnold made changes -
          Field Original Value New Value
          Link This issue is depended upon by LOGCXX-62 [ LOGCXX-62 ]
          Hide
          Curt Arnold added a comment -

          Committed changes in rev 615546 that port enhancements from log4j to log4cxx. The changes properly escape special characters (", &, < and >) in many additional fields that would previous result in an invalid XML entity.

          log4j has decided to not attempt to address encoding mismatch, you should use a UTF-8 or UTF-16 encoding when using an XMLLayout to avoid getting mangled characters.

          Show
          Curt Arnold added a comment - Committed changes in rev 615546 that port enhancements from log4j to log4cxx. The changes properly escape special characters (", &, < and >) in many additional fields that would previous result in an invalid XML entity. log4j has decided to not attempt to address encoding mismatch, you should use a UTF-8 or UTF-16 encoding when using an XMLLayout to avoid getting mangled characters.
          Curt Arnold made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 0.10.0 [ 10782 ]
          Resolution Fixed [ 1 ]

            People

            • Assignee:
              Curt Arnold
              Reporter:
              Curt Arnold
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development