Are you using Apache's Commons logging and are perplexed as to why you cannot control this logging when running inside a Websphere server? The reason is that Commons is just a thin wrapper around (in theory) a logging system of your choice. Many people choose the log4j logger of course.
However, IBM sees fit to direct Commons to its own logger - so, you can configure commons logging all you want, IBM forces it to its own implementation -- the one used to log to the console.
This behavior was impossible to change in 5.1 and it is supposed to be able to change it in 6.x and beyond -- though I don't believe it is simple to do so. I spent a lot of time trying to get around it when our organization was on Websphere 5.1 -- and we started using the log4j logger directly -- so I haven't spent much time investigating it in 6.1.
I don't see any particular advantage to using Commons.. Unless there are very specialized requirements -- don't see any real argument against log4j.
Tuesday, November 3, 2009
Subscribe to:
Post Comments (Atom)
i have managed to get rid of all my commons logging problems by switching to SLF4J. SLF4J inculdes a version of commons logging that calls SLF4J, which then calls Log4J and no more problems with commons loggnig.
ReplyDeleteSLF4J has been adopted by hibernate and a lot of others projects and it has a much nicer API to use for logging than commons logging.