aspose 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 Soft Skills this week in the Jobs Discussion 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();
 
Don't get me started about those stupid light bulbs.
 
subject: log4j configuration in EAR In Web sphere application server 7.0