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 gd...@cmhc-schl.gc.ca on 2004/09/08 22:05:28 UTC

How to log in an XML format

Hi,

I have spent sometime reading and trying to understand Log4j and Chainsaw.
My web application is already logging with Log4j.properties configuration 
file.
The properties are loaded a Filter's init method using the 
PropertyConfigurator.configure method.

How do I get the Log4j to output in an XML format so that Chainsaw can 
read it?

TIA,
Glenn

Re: How to log in an XML format

Posted by Troy Bourdon <tb...@fgm.com>.
Glenn -

Use the XMLLayout in a FileAppender.

example ...

- <#> <appender name="*foo-xml-file*" 
class="*org.apache.log4j.DailyRollingFileAppender*">
  <param name="*File*" value="*logs/FooXML.log4j*" />
  <param name="*Append*" value="*true*" />
<>  <param name="*Threshold*" value="*DEBUG*" /><>
 <param name="*DatePattern*" value="*yyyy-MM-dd-HH'.log4j'*" />
<><layout class="*org.apache.log4j.xml.XMLLayout*" />
</appender>

- Troy

gdeschen@cmhc-schl.gc.ca wrote:

>Hi,
>
>I have spent sometime reading and trying to understand Log4j and Chainsaw.
>My web application is already logging with Log4j.properties configuration 
>file.
>The properties are loaded a Filter's init method using the 
>PropertyConfigurator.configure method.
>
>How do I get the Log4j to output in an XML format so that Chainsaw can 
>read it?
>
>TIA,
>Glenn
>  
>

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