Log4j 2
  1. Log4j 2
  2. LOG4J2-312

XML layout improvements (compact vs. pretty, namespace, namespace prefix, root element).

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta8
    • Fix Version/s: 2.0-beta9
    • Component/s: Layouts
    • Labels:
      None
    • Environment:

      Description

      • The XML root element was “eventSet”, it is now “events”. The word “set” is misleading, because, while unlikely, it is possible that multiple log entries can carry the same timestamp and message.
      • The XML namespace is now includes the log4j version number: http://logging.apache.org/log4j/2.0/events. Previously, it was http://logging.apache.org/log4j/
      • The appender only uses a namespace prefix when needed, that is only for XML fragments, not for well-formed XML, where the default namespace is set to the log4j namespace. This creates much smaller well-formed XML files since no namespace prefixed is used for each element.
      • The namespace prefix is now customizable with “namespacePrefix”, with a default of “log4j”.
      • You can pick between pretty (default) and compact XML (no extra end of lines and indentation). Use compact=”true|false”.
      • Better and updated Javadoc.
      • Updated manual.
      • Use CamelCase for element names, like class names.
      • Use camelCase of attribute names, like instance variables.
      • Add first cut of DTD for XML layout.
      • Add first cut of XSD for XML layout.

        Activity

        Hide
        Gary Gregory added a comment -
        • Use CamelCase for element names, like class names.
        • Use camelCase of attribute names, like instance variables.
        • Add first cut of DTD for XML layout.
        • Add first cut of XSD for XML layout.
        • Remove trailing ‘/’ at the end of the namespace.
        commit -m "- Use CamelCase for element names, like class names...." (12 paths specified)
            Sending        C:/vcs/svn/apache/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/XMLLayout.java
            Adding         C:/vcs/svn/apache/log4j2/trunk/core/src/main/resources/Log4j-events.dtd
            Adding         C:/vcs/svn/apache/log4j2/trunk/core/src/main/resources/Log4j-events.xsd
            Sending        C:/vcs/svn/apache/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/XmlCompactFileAppenderTest.java
            Adding         C:/vcs/svn/apache/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/XmlCompactFileAppenderValidationTest.java
            Sending        C:/vcs/svn/apache/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/XmlCompleteFileAppenderTest.java
            Sending        C:/vcs/svn/apache/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/XmlFileAppenderTest.java
            Sending        C:/vcs/svn/apache/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/XMLLayoutTest.java
            Sending        C:/vcs/svn/apache/log4j2/trunk/core/src/test/resources/XmlCompactFileAppenderTest.xml
            Adding         C:/vcs/svn/apache/log4j2/trunk/core/src/test/resources/XmlCompactFileAppenderValidationTest.xml
            Sending        C:/vcs/svn/apache/log4j2/trunk/core/src/test/resources/XmlCompleteFileAppenderTest.xml
            Sending        C:/vcs/svn/apache/log4j2/trunk/core/src/test/resources/XmlFileAppenderTest.xml
            Transmitting file data ...
            Committed revision 1504299.
        
        Show
        Gary Gregory added a comment - Use CamelCase for element names, like class names. Use camelCase of attribute names, like instance variables. Add first cut of DTD for XML layout. Add first cut of XSD for XML layout. Remove trailing ‘/’ at the end of the namespace. commit -m "- Use CamelCase for element names, like class names...." (12 paths specified) Sending C:/vcs/svn/apache/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/XMLLayout.java Adding C:/vcs/svn/apache/log4j2/trunk/core/src/main/resources/Log4j-events.dtd Adding C:/vcs/svn/apache/log4j2/trunk/core/src/main/resources/Log4j-events.xsd Sending C:/vcs/svn/apache/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/XmlCompactFileAppenderTest.java Adding C:/vcs/svn/apache/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/XmlCompactFileAppenderValidationTest.java Sending C:/vcs/svn/apache/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/XmlCompleteFileAppenderTest.java Sending C:/vcs/svn/apache/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/XmlFileAppenderTest.java Sending C:/vcs/svn/apache/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/XMLLayoutTest.java Sending C:/vcs/svn/apache/log4j2/trunk/core/src/test/resources/XmlCompactFileAppenderTest.xml Adding C:/vcs/svn/apache/log4j2/trunk/core/src/test/resources/XmlCompactFileAppenderValidationTest.xml Sending C:/vcs/svn/apache/log4j2/trunk/core/src/test/resources/XmlCompleteFileAppenderTest.xml Sending C:/vcs/svn/apache/log4j2/trunk/core/src/test/resources/XmlFileAppenderTest.xml Transmitting file data ... Committed revision 1504299.
        Hide
        Gary Gregory added a comment -
        commit -m "[LOG4J2-312] XML layout improvements (compact vs. pretty, namespace, namespace prefix, root element)." (12 paths specified)
            Sending        C:/vcs/svn/apache/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/XMLLayout.java
            Sending        C:/vcs/svn/apache/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/FastXmlFileAppenderTest.java
            Adding         C:/vcs/svn/apache/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/XmlCompactFileAppenderTest.java
            Adding         C:/vcs/svn/apache/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/XmlCompleteFileAppenderTest.java
            Sending        C:/vcs/svn/apache/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/XmlFileAppenderTest.java
            Sending        C:/vcs/svn/apache/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/XMLLayoutTest.java
            Adding         C:/vcs/svn/apache/log4j2/trunk/core/src/test/resources/XmlCompactFileAppenderTest.xml
            Adding         C:/vcs/svn/apache/log4j2/trunk/core/src/test/resources/XmlCompleteFileAppenderTest.xml
            Sending        C:/vcs/svn/apache/log4j2/trunk/core/src/test/resources/XmlFileAppenderTest.xml
            Sending        C:/vcs/svn/apache/log4j2/trunk/core/src/test/resources/log4j.dtd
            Sending        C:/vcs/svn/apache/log4j2/trunk/src/changes/changes.xml
            Sending        C:/vcs/svn/apache/log4j2/trunk/src/site/xdoc/manual/layouts.xml.vm
            Transmitting file data ...
            Committed revision 1504184.
        
        Show
        Gary Gregory added a comment - commit -m "[LOG4J2-312] XML layout improvements (compact vs. pretty, namespace, namespace prefix, root element)." (12 paths specified) Sending C:/vcs/svn/apache/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/layout/XMLLayout.java Sending C:/vcs/svn/apache/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/FastXmlFileAppenderTest.java Adding C:/vcs/svn/apache/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/XmlCompactFileAppenderTest.java Adding C:/vcs/svn/apache/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/XmlCompleteFileAppenderTest.java Sending C:/vcs/svn/apache/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/appender/XmlFileAppenderTest.java Sending C:/vcs/svn/apache/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/layout/XMLLayoutTest.java Adding C:/vcs/svn/apache/log4j2/trunk/core/src/test/resources/XmlCompactFileAppenderTest.xml Adding C:/vcs/svn/apache/log4j2/trunk/core/src/test/resources/XmlCompleteFileAppenderTest.xml Sending C:/vcs/svn/apache/log4j2/trunk/core/src/test/resources/XmlFileAppenderTest.xml Sending C:/vcs/svn/apache/log4j2/trunk/core/src/test/resources/log4j.dtd Sending C:/vcs/svn/apache/log4j2/trunk/src/changes/changes.xml Sending C:/vcs/svn/apache/log4j2/trunk/src/site/xdoc/manual/layouts.xml.vm Transmitting file data ... Committed revision 1504184.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development