You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Davor Cengija <da...@mail.inet.hr> on 2003/01/02 14:13:56 UTC

Beta3: Log4j gone mad

I just upgraded from b2 to b3 and since then Log4j (1.2.6) is acting
strangelly: it ignores the settings and sends everything on stderr.

Here's the log4j.properties (the interesing part):

#log4j.rootLogger=WARN, A1
log4j.logger.com.mycompany=DEBUG, A1
log4j.logger.JBO=WARN, JBO
log4j.logger.org.apache=WARN, A1

log4j.appender.A1=org.apache.log4j.DailyRollingFileAppender
log4j.appender.A1.File=Project.log
log4j.appender.A1.DatePattern='.'yyyy-MM-dd

##########################
# Request logger
log4j.logger.RequestLogger=INFO, REQ1
log4j.appender.REQ1=org.apache.log4j.DailyRollingFileAppender
log4j.appender.REQ1.File=Project.request.log
log4j.appender.REQ1.DatePattern='.'yyyy-MM-dd

##########################
# Oracle JBO
log4j.appender.JBO=org.apache.log4j.DailyRollingFileAppender
log4j.appender.JBO.File=oracle.jbo.trace.log
log4j.appender.JBO.DatePattern='.'yyyy-MM-dd


All the categories are covered by their specific loggers (com.mycompany,
org.apache etc) so I don't need the rootLogger. However, when added
(associated with A1) everything actually goes to A1 (Project.log file) and
not to stderr but the correct files are empty.

This might be the commons-logging.jar issue (while upgrading, I copied all
the libraries, including struts.jar and commons-logging.jar to my
WEB-INF/lib dir).

Anyone?

With struts-b2 (and the corresponding commons- libraries) everything was
quite nice.

I'm using WSAD 4.0.3 and its WebSphere test environment (which is actually
WAS 4.0.2 AES, so servlet spec. 2.2), jdk 1.3.1, log4j 1.2.6.

Thanks.





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Beta3: Log4j gone mad

Posted by Davor Cengija <da...@mail.inet.hr>.
Andreas Mack wrote:
> On Thu, 2003-01-02 at 14:13, Davor Cengija wrote:
>
>
> Maybe. I think I had the same problem, but everything went to root *in
> addition* to the normal files. I've set additivity to false in each of
> my loggers, like:
> -----------------
> log4j.logger.de.mediales.htng=DEBUG, A2
> log4j.additivity.de.mediales.htng=false
>
> log4j.logger.MAIL=DEBUG, M1
> log4j.additivity.MAIL=false
> ----------------
> and it worked fine.

It seems to be working now. Thanks!

> Also make sure you configure common-logging, like
> setting it to SimpleLogger so it won't interfere with log4j. I think
> it uses log4j if available.
>

I'll try this as well.

Many thanks!

Davor





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Beta3: Log4j gone mad

Posted by Andreas Mack <va...@mediales.net>.
On Thu, 2003-01-02 at 14:13, Davor Cengija wrote:

> All the categories are covered by their specific loggers (com.mycompany,
> org.apache etc) so I don't need the rootLogger. However, when added
> (associated with A1) everything actually goes to A1 (Project.log file) and
> not to stderr but the correct files are empty.
> 
> This might be the commons-logging.jar issue (while upgrading, I copied all
> the libraries, including struts.jar and commons-logging.jar to my
> WEB-INF/lib dir).
> 
> Anyone?
> 


Maybe. I think I had the same problem, but everything went to root *in
addition* to the normal files. I've set additivity to false in each of
my loggers, like: 
-----------------
log4j.logger.de.mediales.htng=DEBUG, A2
log4j.additivity.de.mediales.htng=false

log4j.logger.MAIL=DEBUG, M1
log4j.additivity.MAIL=false
----------------
and it worked fine. Also make sure you configure common-logging, like
setting it to SimpleLogger so it won't interfere with log4j. I think it
uses log4j if available.

HTH,

Andreas.

-- 
Andreas Mack <va...@mediales.net>
mediales. GmbH


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>