logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kamal Mettananda <lka...@gmail.com>
Subject XMLLayout indents, but not the first child tag (<Event>)
Date Mon, 28 Mar 2016 19:00:04 GMT
Hi all

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 corrected.
Following is such a sample where <Events> and <Event> are at the same
indent level (0 indent). I do think this is a formatting issue in the code
rather than expected behavior; but I might be wrong?

<?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>

Thanks

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message