简体   繁体   中英

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.

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" ...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM