You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Koller Krisztian <ko...@fw.hu> on 2007/02/23 15:29:39 UTC
tomcat2log4j
Hi,
We run a webapplication on 2 Tomcat 5.5 instance (with file session-sharing)
in cluster.
We use log4j for logging, it logs through a JDBC-Appender to mysql.
We have copied the log4j.jar under WEB-INF/lib directory of webapp. (No
under Tomcats)
Both Tomcat uses the same properties file to initialization (with Init
servlet)
We use MDC.put("id","myid") ...etc. - context of log4j for passing extra
parameters:
log4j.appender.mylog_db.layout.ConversionPattern=INSERT INTO MYLOG(ID, USER,
LEVEL, MESSAGE, DURA, DATUM) VALUES('%X{id}', '%X{user}', '%-5p', '%m',
'%X{dura}', NOW())
At bigger loading: level of MDC the logfiles mingle each other, so same
message become another user's parameter. (Probably the one Tomcat overwrites
the MDC of the another Tomcat, but it is Thread-safe)
What can we do the problem eliminate?
Thanx,
Chris
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org