RE: Problems with log4j configuration

2012-01-23 Thread Bart Berger
If you let your IDE add the import statements, double-check that you're 
importing log4j's Logger and not JBoss's Logger.

Cheers,
Bart

-Original Message-
From: BRUNO MELLONI [mailto:bruno.mell...@chickasaw.net] 
Sent: Monday, January 23, 2012 11:58 AM
To: Log4J Users List
Subject: RE: Problems with log4j configuration

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:









   







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


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



RE: Problems with log4j configuration

2012-01-23 Thread BRUNO MELLONI
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:









   







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



Problems with log4j configuration

2012-01-23 Thread rhaiger

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:









   







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