Simple log4j.xml Example: Difference between revisions
Jump to navigation
Jump to search
(Created page with "=Internal= * log4j <pre> </pre>") |
No edit summary |
||
Line 4: | Line 4: | ||
<pre> | <pre> | ||
<?xml version="1.0" encoding="UTF-8"?> | |||
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> | |||
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false"> | |||
<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender"> | |||
<errorHandler class="org.apache.log4j.helpers.OnlyOnceErrorHandler"/> | |||
<param name="Target" value="System.out"/> | |||
<param name="Threshold" value="INFO"/> | |||
<layout class="org.apache.log4j.PatternLayout"> | |||
<param name="ConversionPattern" value="@%t %d{ABSOLUTE} %-5p [%c{1}] %m%n"/> | |||
</layout> | |||
</appender> | |||
<!-- | |||
<appender name="FILE" class="org.apache.log4j.DailyRollingFileAppender"> | |||
<errorHandler class="org.apache.log4j.helpers.OnlyOnceErrorHandler"/> | |||
<param name="File" value="${test.log.directory}/test.log"/> | |||
<param name="DatePattern" value="'.'yyyy-MM-dd"/> | |||
<param name="Threshold" value="DEBUG"/> | |||
<param name="Append" value="false"/> | |||
<layout class="org.apache.log4j.PatternLayout"> | |||
<param name="ConversionPattern" value="@%t %d{ABSOLUTE} %-5p [%c{1}] %m%n"/> | |||
</layout> | |||
</appender> | |||
--> | |||
<category name="io.novaordis.example"> | |||
<priority value="WARN"/> | |||
</category> | |||
<root> | |||
<appender-ref ref="CONSOLE"/> | |||
<!-- <appender-ref ref="FILE"/> --> | |||
</root> | |||
</log4j:configuration> | |||
</pre> | </pre> |
Latest revision as of 17:59, 8 November 2016
Internal
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false"> <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender"> <errorHandler class="org.apache.log4j.helpers.OnlyOnceErrorHandler"/> <param name="Target" value="System.out"/> <param name="Threshold" value="INFO"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="@%t %d{ABSOLUTE} %-5p [%c{1}] %m%n"/> </layout> </appender> <!-- <appender name="FILE" class="org.apache.log4j.DailyRollingFileAppender"> <errorHandler class="org.apache.log4j.helpers.OnlyOnceErrorHandler"/> <param name="File" value="${test.log.directory}/test.log"/> <param name="DatePattern" value="'.'yyyy-MM-dd"/> <param name="Threshold" value="DEBUG"/> <param name="Append" value="false"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="@%t %d{ABSOLUTE} %-5p [%c{1}] %m%n"/> </layout> </appender> --> <category name="io.novaordis.example"> <priority value="WARN"/> </category> <root> <appender-ref ref="CONSOLE"/> <!-- <appender-ref ref="FILE"/> --> </root> </log4j:configuration>