3 messages in org.apache.logging.log4j-userRE: log4j initialization - weblogic- ...
FromSent OnAttachments
Stephen PainJun 15, 2004 1:54 pm 
Donald LarmeeJun 15, 2004 2:58 pm 
Jacob KjomeJun 15, 2004 9:51 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:RE: log4j initialization - weblogic- ear fileActions...
From:Donald Larmee (dlar@alterthought.com)
Date:Jun 15, 2004 2:58:21 pm
List:org.apache.logging.log4j-user

Stephen,

What version of WLS are you using? WLS 8.X supports a very handy ear level construct APP-INF/lib and APP-INF/classes that function in a similar fashion to the war equivalent WEB-INF/lib and WEB-INF/classes.

So if you are using WLS 8.x you can simply put your log4j.jar in the APP-INF/lib and your log4j.properties file in the APP-INF/classes dir and you should be good to go.

It should be noted that APP-INF construct _is_ proprietary, but it has growing support and is also (I believe) supported by current version of WebSphere.

If you are simply trying to use a WebApp, it should suffice to put the log4j.jar in the WEB-INF/lib and the log4j.properties file in the WEB-INF/classes file.

Hope it helps.

-d

-----Original Message----- From: Stephen Pain [mailto:step@db.com] Sent: Tuesday, June 15, 2004 4:54 PM To: Log4J Users List Subject: log4j initialization - weblogic- ear file

Hi,

Reading the manual I found the example Initialization servlet. I've tried to get this working in our app but I'm experiencing problems because getServletContext().getRealPath("/") returns null (Having spent a while googling, I think this is because I'm packaging everything in an ear file).

Is there a recommended way of getting round this?

(background):

We want to use JMS for logging under log4j (so that we can use Chainsaw - with SocketHubAppender we can lock the entire weblogic node if a chainsaw gui locks up). This was ok until we tried to integrate an external authentication library with the app, which apparently also uses log4j. The problem is, this lib gets initialised as a service in weblogic, *before* the JMS service has started up, causing big problems. I've tried putting log4j.properties inside the ear file on the manifest class-path but it doesn't seem to be found. I've also tried using a config.jar containing a single log4j.properties file and referencing this jar on the manifest class-path, with no success. Now planning to use a default log4j.properties in the domain root, defining just a fileAppender and then adding the JMSAppender using the initialization servlet.

Any help gratefully received!

Cheers, Stephen