You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Stephen Pain <st...@db.com> on 2004/06/15 22:54:22 UTC

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



--

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


RE: log4j initialization - weblogic- ear file

Posted by Donald Larmee <dl...@alterthought.com>.
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:stephen.pain@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



--

This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org