aspose file tools*
The moose likes Java in General and the fly likes configuring log4j using env variables Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "configuring log4j using env variables" Watch "configuring log4j using env variables" New topic
Author

configuring log4j using env variables

Harjit Singh
Ranch Hand

Joined: Feb 01, 2007
Posts: 77
Hi there,

Is there any way to configure the log4j file using environement variables. We don't want to hard code the path in the log4j configuration file.

Thanks

- Harjit
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8710
    
    6

I'm not aware of any functionality to do so in the Log4j API.
You can programmatically configure Log4j as described in the manual (scroll down to "configuration"). There's no reason you couldn't read environment variables to get those settings.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: configuring log4j using env variables
 
Similar Threads
How can I get OS environment variables in log4j
log4j - different log file based on Threshold value
log4j error message - please send solutions
Path to locate properties file of log4j
Third party libraries and WSAD 5.1.0