wood burning stoves 2.0*
The moose likes EJB and other Java EE Technologies and the fly likes location for log4j.properties for my EAR Application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "location for log4j.properties for my EAR Application" Watch "location for log4j.properties for my EAR Application" New topic
Author

location for log4j.properties for my EAR Application

Sonx Nkuks
Ranch Hand

Joined: Aug 20, 2010
Posts: 47
Hi, i have the following project structure : MyProjEAR, MyProjEJB, MyProjEJBClient, MyProjTestApp, MyProjConfig ... I've put my hibernate.cfg and log4j.properties in the MyProjConfig/properties project folder and added this folder on my MyProjTestApp Java Application build path. I can see the logs on output when i run my java App but get

MyProjManagerServiceImpl class uses LOGGER and is within the MyProjEJBClient project packages... As this is deployed on the WebSphere server (with EAR), where or how do i reference my log4j.properties? should i include the properties folder in each project build path?
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30076
    
149

Sonx,
In JEE there are two types of paths. The build path is a compile time path. At runtime another path is used which is the manifest.mf classpath plus any other classpaths defined on your server. I recommend adding the MyProjConfig/properties directory to your server's classpath.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Sonx Nkuks
Ranch Hand

Joined: Aug 20, 2010
Posts: 47
Jeanne Boyarsky wrote:Sonx,
In JEE there are two types of paths. The build path is a compile time path. At runtime another path is used which is the manifest.mf classpath plus any other classpaths defined on your server. I recommend adding the MyProjConfig/properties directory to your server's classpath.


Hi Jeanne , i tried googling on how to add libraries or configuration to WAS classpath but not quite sure i got correct answer. Should i add this as shared library reference or just copy the log4j.properties to <WAS_ROOT>/properties folder? What/where exactly can i add external folders or worskpace folders to WAS classpath?
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30076
    
149

It's under Java and Process Management in the admin console. The exact location will depend on your version of WebSphere.
 
jQuery in Action, 2nd edition
 
subject: location for log4j.properties for my EAR Application
 
Similar Threads
Not able to initialize the log4j.properties
log4j:WARN No appenders could be found for logger (log4jexample.LogExample).
RAD7 - Trying to get log4j to work
log4j ClassNotFoundException
Can't find logj4.properties using netbeans, hibernate and glassfish