This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Other Open Source Projects and the fly likes where to place log4j.properties file Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Reply Bookmark "where to place log4j.properties file" Watch "where to place log4j.properties file" New topic
Author

where to place log4j.properties file

S.S Rao
Greenhorn

Joined: Aug 01, 2005
Posts: 2
hi,

I am using log4j in my J2EE application. We use RAD for our deevlopment and the application server is WAS 6.0. We used to place the log4j.properties in the properties folder of the application server and it was working fine. But now we are asked to put the properites file with in the application EAR itself. How to do that ?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 16483
    
    2

Put it in the same directory where you would put jar files in the EAR. The properties file just has to be in the classpath so that should work correctly. You should probably have the log4j.jar file in the EAR as well, it's probably higher in the classloader hierarchy than the WAR file is.
Benson Fung
Ranch Hand

Joined: Apr 10, 2003
Posts: 207
Hi Paul,

I am also have the same case. I try to put the properties file in the MDB jar file. However, it looks the the JBOSS only read its built-in log4j.xml. Do you know how to fix this problem?


thanks
Benson
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 8143
    
  52

That's right, JBoss uses the log4j.xml that comes shipped with it. Have a look at ScopedLoggingConfig, if you want to use your own log4j.properties or log4j.xml


[My Blog] [JavaRanch Journal]
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: where to place log4j.properties file
 
Similar Threads
ejb and web app. logging with log4j
log4j.properties
cant run log4J
where to put log4j.properties file in visual web jsf
Runtime changes to log4j.properties