Codice: Seleziona tutto
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">
<Properties>
<Property name="filename">log/test.log</Property>
</Properties>
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
</Console>
<File name="File" fileName="${filename}">
<PatternLayout>
<pattern>%d %p %C{1.} [%t] %m%n</pattern>
</PatternLayout>
</File>
</Appenders>
<Loggers>
<Root level="trace">
<AppenderRef ref="Console" level="trace"/>
<AppenderRef ref="File" level="debug"/>
</Root>
</Loggers>
</Configuration>
Esso stampera' a video tutti i messaggi da TRACE in poi e memorizzera' su file tutti i messaggi da DEBUG in poi.