Hello, I've written my own XLogger extends Logger and I've been using it without problems in stand-alone apps and Web containers. In my log4j.properties I specify that my Factory should be used so 3rd party jars which use standard Logger also use my XLogger:
log4j.loggerFactory=com.sdmc.XLoggerFactory log4j.categoryFactory=com.sdmc.XLoggerFactory Also, to debug commons stuff, i have commons-logging.properties stating: org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.Log4jFactory Now... i have a WebSphere 4.0 EAR with 1 web and 1 ejb module. When an ejb using XLogger is created i get a ClassCastException on XLogger. Probably a Logger is already instantiated before my log4j.properties is being read so the Logger singleton is a Logger, not an XLogger I tried putting log4j.properties in my ejb jar, i tried putting it in the root of the ear and adding it to the Manifest.mf. Now i may end up writing my own Configurator but **who is going to call it**? When using log4j in a web container you can have a Log4jInitServlet (start-up=1) to initialize log4j... but when in a ejb container... how is this Log4jInitBean going to be the first thing to be created? I have run out of options, just bought Ceki Gulcu's "Complete Log4j manual" but i cannot find an answer. On page 92 it says what not to do in case of WebSphere.. but doesn't say what to do... Think part of the problem might be in the fact that WebSphere uses commons-logging under the hood? Hope somebody can help me out! Thanks, - Marcel Heemskerk --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
