Noget i retning af
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "
http://logging.apache.org/log4j/docs/api/org/apache/log4j/xml/log4j.dtd"><log4j:configuration>
<appender name="RollingAppender" class="org.apache.log4j.DailyRollingFileAppender">
<param name="File" value="output.log"/>
<param name="DatePattern" value="'.'yyyy-MM-dd"/>
<param name="Threshold" value="ERROR"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss} %-5p %c{2}(%M:%L) - %m%n"/>
</layout>
</appender>
<appender name="ConsoleAppender" class="org.apache.log4j.ConsoleAppender">
<param name="Threshold" value="DEBUG"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss} %-5p %c{2}(%M:%L) - %m%n"/>
</layout>
</appender>
<appender name="EmailAppender" class="klassesomarverfrasmtpappender">
<param name="EvaluatorClass" value="MinEvaluator"/>
<param name="Threshold" value="ERROR"/>
<param name="SMTPHost" value="smtp.gmail.com"/>
<param name="To" value="min@mail.com"/>
<param name="From" value="fra@mail.com"/>
<param name="BufferSize" value="1" />
<param name="LocationInfo" value="true"/>
<param name="Subject" value="[SMTPAppender] Application message" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %-5p %c(%M:%L) - %m%n"/>
</layout>
</appender>
<logger name="org.apache.axis">
<level value="OFF"/>
</logger>
<logger name="dk">
<level value="info"/>
<appender-ref ref="RollingAppender"/>
</logger>
<root>
<level value="info"/>
<appender-ref ref="ConsoleAppender"/>
<appender-ref ref="EmailAppender"/>
</root>
</log4j:configuration>