Kamal Mettananda created LOG4J2-1372:
----------------------------------------

             Summary: XMLLayout indents, but not the first child tag (<Event>)
                 Key: LOG4J2-1372
                 URL: https://issues.apache.org/jira/browse/LOG4J2-1372
             Project: Log4j 2
          Issue Type: Bug
          Components: Layouts
    Affects Versions: 2.5
            Reporter: Kamal Mettananda
            Priority: Minor


I am using log4j 2.5 to print the logs via XMLLayout. I have set 
compact="true", hence the new line and indents of sub tags work correctly. 
However I have noticed that the first child tag is not indented correctly. 

Following is such a sample where <Events> and <Event> are at the same indent 
level (0 indent). 

{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<Events xmlns="http://logging.apache.org/log4j/2.0/events";>
<Event xmlns="http://logging.apache.org/log4j/2.0/events"; 
timeMillis="1459191034362" thread="main" level="INFO" 
loggerName="org.logging.learn.log4j.Main" endOfBatch="false" 
loggerFqcn="org.apache.logging.log4j.spi.AbstractLogger">
  <Message>6 + 4 = 10</Message>
</Event>

<Event xmlns="http://logging.apache.org/log4j/2.0/events"; 
timeMillis="1459191034457" thread="main" level="INFO" 
loggerName="org.logging.learn.log4j.Main" endOfBatch="false" 
loggerFqcn="org.apache.logging.log4j.spi.AbstractLogger">
  <Message>6 - 4 = 2</Message>
</Event>

</Events>
{code}




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to