• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

log4j configuration in EAR In Web sphere application server 7.0

 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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();
 
reply
    Bookmark Topic Watch Topic
  • New Topic