Quoting Michael A Chase <[EMAIL PROTECTED]>: > I'm not at work now so I don't have the exact version information, but I > don't think it matters much. > > We are running a web application under OC4J which provides logging via a > ServletContext com.evermind.http.Application. We've converted all our > code to use log4j, but we are still seeing errors from lower level code > going to the original log file. > > Can anyone point me to some way to capture the logging done via > (ServletContext).log() so everything can go through log4j? >
Grab the LOG4J_SANDBOX_ALPHA3 tag of the logging-log4j-sandbox and build yourself to get the ServletContextLogAppender, compatible with Log4j-1.2.xx (HEAD compatible with Log4j-1.3... to the best of my recollection). http://cvs.apache.org/viewcvs.cgi/logging-log4j-sandbox/src/java/org/apache/log4j/servlet/ServletContextLogAppender.java?rev=1.6&view=log Note that this doesn't always seem to work well (or at all) in an environment that does parent-first classloading and/or log4j.jar isn't stored in each individual webapp along with parent-last classloading (such as Tomcat). So, if you deploy log4j-sandbox.jar and log4j.jar in each webapp's WEB-INF/lib along with parent-last classloading, this should work pretty well for you. Make sure to test this yourself before assuming it will work in your environment. Consider this the reason why it is still in the sandbox rather than log4j proper. Jake > -- > Mac :}) > Give a hobbit a fish and he eats fish for a day. > Give a hobbit a ring and he eats fish for an age. > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
