AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

log4j configurazione xml

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java (Italian)
View previous topic :: View next topic  
Author Message
elhja
Guest





PostPosted: Thu Aug 26, 2004 10:23 am    Post subject: log4j configurazione xml Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java (Italian) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.