 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
elhja Guest
|
Posted: Thu Aug 26, 2004 10:23 am Post subject: log4j configurazione xml |
|
|
Salve a tutti,
qualcuno ha un esempio di file di configurazione per log4j che rediriga i
messaggi di log di ciascuna classe in un diverso file di log?
Sto scrivendo un'applicazione java (1.4.2) facendo uso della libreria
jakarta-log4j-1.2.8.
Per la configurazione dei logger uso un file XML 'log4j.xml' del tipo:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<appender name="aClasse01" class="org.apache.log4j.FileAppender">
<param name="File" value="F:\log\classe01.log"/>
<param name="Append" value="true"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{ISO8601} [%t][line:%L] %p -
%m%n"/>
</layout>
</appender>
<logger name=Classe01">
<priority value="DEBUG"/>
<appender-ref ref="aClasse01"/>
</logger>
</log4j:configuration>
Evidentemente sbaglio qualcosa perché pur reindirizzando correttamente i
messaggi di log di ciascuna classe in un apposito file di log, nello
standard output ricevo l'errore:
log4j:ERROR Parsing error on line 78 and column -1
log4j:ERROR Lelemento "{0}" non consente "{1}" qui.
log4j:ERROR Parsing error on line 83 and column -1
log4j:ERROR Lelemento "{0}" non consente "{1}" qui.
log4j:ERROR Parsing error on line 88 and column -1
log4j:ERROR Lelemento "{0}" non consente "{1}" qui.
log4j:ERROR Parsing error on line 93 and column -1
log4j:ERROR Lelemento "{0}" non consente "{1}" qui.
Grazie a tutti.
Simone
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|