You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Greg Flex <gr...@gmail.com> on 2009/05/01 03:30:54 UTC

Re: XMLLaout

I've figure it out.....
LocationInfo needs to be set to true to get these values. (default is false)
For those interested here is the proper XMLLayout file.

<!-- log info level into log.xml -->
     <appender name="XMLOUT" class="org.apache.log4j.FileAppender">
        <param name="File" value="C:\\tmp\\log.xml"/>
        <param name="Threshold" value="info"/>
        <layout class="org.apache.log4j.xml.XMLLayout">
            <param name="LocationInfo" value="true"/>
        </layout>
    </appender>

Greg



On Thu, Apr 30, 2009 at 11:55 AM, Greg Flex <gr...@gmail.com> wrote:

> Hi Guys,
> I have this for now in my config.xml file that configures the logger.
>
> <appender name="XMLOUT" class="org.apache.log4j.FileAppender">
>      <param name="File" value="C:\\tmp\\log.xml"/>
>      <param name="Threshold" value="info"/>
>      <layout class="org.apache.log4j.xml.XMLLayout"/>
> </appender>
>
> It all works just fine but when I view logs with the Chainsaw I'm not
> getting any class name or a method name or line number.
> In fact, I'm not getting anything that I'd need.
> I can get all these values when I use the file appender with the
> ConversionPattern.
> I guess my question is, how do I get all these values but in XML format
> with the XMLLayout.
> Is this even possible?  I'd imagine it is since the Chainsaw Log Viewer
> "tries" to read them....
> Thanks
> Greg.
>