Looks right to me, but I don't remember the RollingFileAppender parameters.

I suggest you:

1) Look in server.log and see if your entries might be going there.
2) Check for typos.
3) Try implementing your AUDITOR appender by cut/pasting the FILE appender that 
is there as a starting point.
4) Instead of using static and specifying the class use "private final Logger 
logger = Logger.getLogger(this.getClass());"

-----Original Message-----
From: rhaiger [mailto:rhai...@gmail.com] 
Sent: Monday, January 23, 2012 1:45 PM
To: log4j-user@logging.apache.org
Subject: Problems with log4j configuration


Hello guys, I'm new in this forum and I think you may help me with an issue...

I'm trying to use log4j to log some login auditing informations, and I'm using 
JBoss 4 and Java with compliance level 5.0. It's a very old legacy system...

I've added this lines at my log4j.xml:

<appender name="AUDITOR"
class="org.jboss.logging.appender.RollingFileAppender">
    <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
    
    
    
    
    <layout class="org.apache.log4j.PatternLayout">
        
    </layout>       
</appender>

<category name="com.itautec.siac.controleAcesso" additivity="false">
    <priority value="INFO"/>
    <appender-ref ref="AUDITOR"/>
</category>

And in my Foo.java class, I've added this field:

private static final Logger logger = Logger.getLogger(Foo.class);

When I want to log something (inside my Foo.java class), I just call my logger 
with something like:

logger.info("any message");


Well, after that, I start JBoss4, and I can see that Auditor.log file is 
created in my log folder, as it should be, but everything I try to log doesn't 
appear in my Auditor.log file... :-(

When I start my application in debug mode, I can see that I'm passing through 
several loggers that I've put in my Foo.java class, but it seems that log4j is 
just ignoring these callings and nothing is logged at all...

Does anyone know what's happening? It seems to be something really simple, but 
I can't figure it out! :-((

Thanks from now and best regards! :-)
--
View this message in context: 
http://old.nabble.com/Problems-with-log4j-configuration-tp33190553p33190553.html
Sent from the Log4j - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org

Reply via email to