This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills and have John Sonmez on-line!
See this thread for details.
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


Win a copy of Soft Skills this week in the Jobs Discussion forum!
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: 8994
    
    9

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.


[How To Ask Questions On JavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: configuring log4j using env variables