my dog learned polymorphism*
The moose likes Other Open Source Projects and the fly likes is it possible to set the log4j log file location using web.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "is it possible to set the log4j log file location using web.xml" Watch "is it possible to set the log4j log file location using web.xml" New topic
Author

is it possible to set the log4j log file location using web.xml

peter tong
Ranch Hand

Joined: Mar 15, 2008
Posts: 240
as caption, in presence, the log file location is set in log4j.properties, log4j.appender.A2.File={path}
is it possible to change set the log file location using web.xml?
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30138
    
150

The short answer is yes.

Search for "initialization servlet" on the manual page. This doesn't show exactly what you want. But you could configure anything you want this way. You could even write out a property file at runtime based completely on information in your web.xml.

Why do you want to though? A property file is more external/easier to change than the web.xml which is part of the app.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: is it possible to set the log4j log file location using web.xml
 
Similar Threads
Starting Sonar at 9000 port
tag libs with weblogic6.1
Setting Common folder for all clusters in websphere and displaying files from that folder in page
web.xml
JSP cannot call Servlet