Is it possible to have log4j.xml loaded from a different dir than source root and how? (programmatically?) Meaning that it's somewhere in FS not just in classpath.
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- Illegal to have multiple roots (start tag in epilo
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
This might not be the best way, but you can specify the location of the file by setting the java property log4j.configuration=path/to/config/file. For example, you can specify this directly to the java command with
java -Dlog4j.configuration=path
.Using DOMConfigurator you can specify the the XML file used to configure log4j.
For log4j.properties you can do the same thing with PropertyConfigurator.