PRINCE GUPTA
PRINCE GUPTA

Reputation: 33

Log4j.xml dynamic file attributes

I am deploying my application in websphere server and i want to set param File attribute of log4j.xml. Locally i am doing like

<param name="File" value="C:\\logs\\cle_error.log" />

My server name is App_Admin and path where i want to generate debug.log file is /waslib/appadmin/uat/logs.

Upvotes: 0

Views: 197

Answers (1)

SMA
SMA

Reputation: 37023

You could use System property for this like:

<param name="File" value="${mylog.path}" />

And when you start your application, you could just pass system property like:

java -Dmylog.path="/waslib/appadmin/uat/logs" ...

Upvotes: 1

Related Questions