Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

log4j configuration in EAR In Web sphere application server 7.0

 
Matt Swaggi
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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();
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic