logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Himanshu Shah" <hjh...@gmail.com>
Subject Websphere log4j configuration
Date Tue, 22 Apr 2008 01:04:58 GMT
I have .ear application deployed in websphere. It has two war, one ejb and
one rar modules. I set the -Dlog4j.configuration=path to log4j.xml file as
JVM argument. In websphere my application class loading policy is set to:

   - Classloader order: Classes loaded with application class loader
   first
   - WAR class loader policy: Single class loader for application

I have my custom layout class which extends log4j's layout. I have
implemented getHeader() method which returns information such as product
name, version, host name etc. My problem is during websphere and application
startup header gets printed twice in log files (log messages are ok, they
are not printed twice). After debugging it looks like log4j is initialized
twice during each "war" loading.

Is this possible? Or is it something else?
P.S. log4j.jar resides in my application's .ear file.

-- 
Himanshu
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Fill the brain with high thoughts, highest ideals, place them day and night
before you, and out of that will come great work.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message