This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Other Open Source Projects and the fly likes struts & where to place log4j.properties Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "struts & where to place log4j.properties" Watch "struts & where to place log4j.properties" New topic
Author

struts & where to place log4j.properties

Prashant Mehendru
Greenhorn

Joined: Sep 01, 2003
Posts: 2
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.
R K Singh
Ranch Hand

Joined: Oct 15, 2001
Posts: 5376
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


"Thanks to Indian media who has over the period of time swiped out intellectual taste from mass Indian population." - Chetan Parekh
Prashant Mehendru
Greenhorn

Joined: Sep 01, 2003
Posts: 2
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.
 
Have you checked out Aspose?
 
subject: struts & where to place log4j.properties
 
It's not a secret anymore!