File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Websphere and the fly likes log4j configuration in EAR In Web sphere application server 7.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "log4j configuration in EAR In Web sphere application server 7.0" Watch "log4j configuration in EAR In Web sphere application server 7.0" New topic
Author

log4j configuration in EAR In Web sphere application server 7.0

Matt Swaggi
Ranch Hand

Joined: May 29, 2008
Posts: 61
I am trying to configure log4j at EAR level. I mean I want to have the log4j.properties specified in the EAR so that the WebApp and EJB modules (deployed in separate jars) can share the same lo4j configuration.

My environment is WAS 7.0 , I use RAD 7.5. Any suggestion is appreciated



Thanks
balaji subbu
Greenhorn

Joined: Nov 14, 2011
Posts: 11
yes you can copy the log4j.properties in config directory of WAS(IBM\WebSphere\AppServer\profiles\AppSrv01\config)

and use the below code to access it.

this.LogconfigPath = ("" + (file.getAbsolutePath() == null ? "" : file.getAbsolutePath()));
this.LogconfigPath = (this.LogconfigPath + File.separator +"Log4J.properties");
balaji subbu
Greenhorn

Joined: Nov 14, 2011
Posts: 11
For you use

LogconfigPath = (new StringBuilder()).append("").append(file.getAbsolutePath() == null ? "" : file.getAbsolutePath()).toString();
LogconfigPath = (new StringBuilder()).append(LogconfigPath).append(File.separator).append("Log4J.properties").toString();
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: log4j configuration in EAR In Web sphere application server 7.0
 
Similar Threads
Any body use Log4J with Tomcat?
RAD7 - Trying to get log4j to work
Getting Log4J working in RAD 7.0
Manifest file not working in J2EE project?
Own configure for Log4j