• 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

struts & where to place log4j.properties

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am using log4j as my default logging system. Could you tell me if I can place log4j.properties in any folder besides the $\WEB-INF\classes\? And, if so, how? (I mean, where do I need to tell my application that it would find the properties file in "xyz" folder?)
Thanks.
 
Ranch Hand
Posts: 5399
1
Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can place your log4j properties file anywhere you wish.
If you place in the classes directory, then it automatically comes in the classpath and logger can find it from the classpath.
If you place your prop file anywhere else then in your initLog() method you pass the file path.
Exa:

HTH
 
Prashant Mehendru
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks.
Actually, I had been looking for a default location for WebSphere. Something like the root folder where WebSphere searched first. Applying some hooks, I realized that it first read the /properties folder. So, I simply placed my log4j.properties there
Makes life much simpler And of course, efficient!
I am using the logger only for debugging purposes currently.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic