logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kamal Mettananda (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LOG4J2-1372) XMLLayout indents, but not the first child tag (<Event>)
Date Wed, 20 Apr 2016 17:04:25 GMT

    [ https://issues.apache.org/jira/browse/LOG4J2-1372?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15250267#comment-15250267
] 

Kamal Mettananda commented on LOG4J2-1372:
------------------------------------------

Hi [~garydgregory]

Yes, that looks much better, thanks for the update. Sure, I will minimize the blank lines
in next patches.

If you could do a slight change to the Javadocs of Log4jXmlPrettyPrinter, it would be perfect
(link missing due to package change - just need to add XmlLayout in front of #getHeader()
& #getFooter()).

*Existing Javadoc:*
{noformat}
    /**
     * When &lt;Event&gt;s are written into a XML file; the "Event" object is not
the root element, but an element named
     * &lt;Events&gt; created using {@link #getHeader()} and {@link #getFooter()}
methods.<br/>
     * ...
{noformat}

*Expected Javadoc:*
{noformat}
    /**
     * When &lt;Event&gt;s are written into a XML file; the "Event" object is not
the root element, but an element named
     * &lt;Events&gt; created using {@link XmlLayout#getHeader()} and {@link XmlLayout#getFooter()}
methods.<br/>
     * ...
{noformat}

Thanks

> 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
>            Assignee: Gary Gregory
>            Priority: Minor
>             Fix For: 2.6
>
>         Attachments: LOG4J2-1372_01.patch
>
>
> 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="1460974404123"
thread="main" level="INFO" loggerName="com.foo.Bar" endOfBatch="true" loggerFqcn="org.apache.logging.log4j.spi.AbstractLogger"
threadId="11" threadPriority="5">
>   <Message>First Msg tag must be in level 2 after correct indentation</Message>
> </Event>
> <Event xmlns="http://logging.apache.org/log4j/2.0/events" timeMillis="1460974404133"
thread="main" level="INFO" loggerName="com.foo.Bar" endOfBatch="true" loggerFqcn="org.apache.logging.log4j.spi.AbstractLogger"
threadId="11" threadPriority="5">
>   <Message>Second Msg tag must also be in level 2 after correct indentation</Message>
> </Event>
> </Events>
> {code}



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

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message