|Title|Multiple JSPWiki instances use same log file when told otherwise
|Date|21-Feb-2006 13:18:08 EET
|Submitter|Wouter Van daele
|[Bug criticality]|EnhancementRequest
|Browser version|N/A
|[Bug status]|ClosedBug
|[PageProvider] used|
|Servlet Container|Tomcat 5.0.25
|Operating System|AIX 5.2
|Java version|1.4.2

I'm not sure if it's a bug, but...

I have multiple Wikis running as separate webapps in a single Tomcat. The {{jspwiki.war}} is shared.

The {{jspwiki.properties}} for each of the Wikis contain a separate file name for the log (logging is through the Commons logging mechanism provided with JSPWiki). And yet __I see log entries for multiple sites in a single log file__. Worse: there are entries for each of the Wikis in each and every one of the log files. Watching a log file grow during a session where multiple Wikis are visited, it seems the webapp writes all logging to a single log - as if the choice of log file is based on session, not on the webapp.

If it's not a bug, can somebody explain to me what exactly is happening? --[Wouter]


That sounds mighty strange.  Any chance you could cut-n-paste your log config here?

-- JanneJalkanen
Each of the instances has its own {{jspwiki.properties}} file (of course) containing these instructions, each a with different filename (of course!). I've shortened the pathname, but that shouldn't make any difference...
log4j.appender.FileLog.layout.ConversionPattern=%d [%t] %p %c %x - %m%n

2006-02-27: I have been working with my sysadmin all afternoon, and for the moment we have decided to make all Wikis log their info in one and the same file. Two things are worth mentioning:
* I had a "logical" pathname in the properties ({{/data}} being a link to {{/prd/data}}). Since we suspected this to be a cause of problems, I've changed all pathnames to the "real" pathnames, but that did not seem to solve the problem (yes, we restarted Tomcat completely as well).
* We are under the impression that {{log4j}} (or is it {{jspwiki}}?) is incapable of distinguishing the required Wiki instances because of the sharing of the class/jar files ({{log4j}} included.).. What's worse, since a few days we have regular crashes of Tomcat, without any specific indication of what the real problem is!


It looks like you are trying to use multiple log4j configurations in one JVM.
This is only possible if the log4j config is loaded under different classloaders.
In general this means that if log4j classes get loaded by a classloader that is fairly high in the classloading hierarchy, that the log4j configuration that was loaded by your jspwikiA gets overwritten by jspwikiB.
If you want to see what log4j is actually doing, you could add the java system property log4j.debug to your JVM startup (like -Dlog4j.debug=true).

I'm not an expert in Tomcat (classloading), but I have experience with the same problems with log4j in WebSphere.
Harry Metske

--HarryMetske, 29-Jun-2006


Wouter, have you managed to do some more debugging with -Dlog4j.debug=true ?

--HarryMetske, 04-Mar-2007

I don't expect an answer anymore, closing the bug, feel free to re-open if you have managed to do some further diagnostics.