Log::Log4perl::Config::DOMConfigurator - reads xml
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> <appender name="FileAppndr1" class="org.apache.log4j.FileAppender"> <layout class="Log::Log4perl::Layout::PatternLayout"> <param name="ConversionPattern" value="%d %4r [%t] %-5p %c %t - %m%n"/> </layout> <param name="File" value="t/tmp/DOMtest"/> <param name="Append" value="false"/> </appender> <category name="a.b.c.d" additivity="false"> <level value="warn"/> <!-- note lowercase! --> <appender-ref ref="FileAppndr1"/> </category> <root> <priority value="warn"/> <appender-ref ref="FileAppndr1"/> </root> </log4j:configuration>
This parses an XML file that conforms to the log4j.dtd, q.v. It currently does not handle any of the log4perl extensions we've been coming up with, but that should hopefully follow shortly.
You use it just like you would a properties config but if the data starts with an xml declaration <\?xml ... then it gets parsed by this DOMConfigurator instead of the PropertiesConfigurator.
<\?xml ...
Note that you need XML::DOM installed.
The code is brazenly modeled on log4j's DOMConfigurator class, (by Christopher Taylor, Ceki Gülcü and Anders Kristensen) and any perceived similarity is not coincidental.
It is still (version 0.02 Jan-2002) very fresh, alpha software, please check it out thoroughly before use and let me know if you find any problems.
t/038XML-DOM1.t for examples
Log::Log4perl::Config
Log::Log4perl::Config::PropertyConfigurator
Log::Log4perl::Config::LDAPConfigurator (coming soon!)
Kevin Goess, <cpan@goess.org> Jan-2003
1 POD Error
The following errors were encountered while parsing the POD:
Non-ASCII character seen before =encoding in 'Gülcü'. Assuming CP1252
To install Log::Log4perl, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Log::Log4perl
CPAN shell
perl -MCPAN -e shell install Log::Log4perl
For more information on module installation, please visit the detailed CPAN module installation guide.