GeeCON Prague 2014*
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


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
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30586
    
154

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
 
GeeCON Prague 2014
 
subject: is it possible to set the log4j log file location using web.xml