vvekselva
vvekselva

Reputation: 823

Log4j Properties File Configuration

I'm using Log4j for logging my system events.

Initially I used the Log4j properties file and then shifted to log4j.xml file.

My application has another property file - system.properties - that takes the configuration parameters.

I want the log output file to be specified in the application properties file - system.properties and refer the properties file in the log4j.xml file and also update the configuration.

Is it possible with this log4j.xml configuration?

Upvotes: 0

Views: 468

Answers (1)

Ashay Batwal
Ashay Batwal

Reputation: 5623

You can do it by using ant scripts. Load the system.properties file in ant and replace the value inside the log4j.xml file.

Refer to this link on how to update XML file. How to update an XML document with Ant

Upvotes: 1

Related Questions