markus markus - 5 months ago 42
Java Question

Change location of

I want to put all my config files in a

subfolder of my application directory. Log4j is expecting the file in the root folder of my application. Is there a way to tell log4j where to look for the properties file?


Yes, define log4j.configuration property

java -Dlog4j.configuration=file:/path/to/ myApp

Note, that property value must be a URL.

For more read section 'Default Initialization Procedure' in Log4j manual.