how to set log4j.configuration system variable in WebSphere 7?

后端 未结 3 1485
囚心锁ツ
囚心锁ツ 2020-12-31 17:13

I have a Java EE 5 web app I\'m deploying to WebSphere 7 as an EAR file.

I want my log4j configuration to be external to the EAR file so I can tweak log content when

3条回答
  •  [愿得一人]
    2020-12-31 18:06

    The log4j.configuration property is a Java Virtual Machine system property. You can load this property by adding it to the end of your application server's list of generic JVM arguments. This is done in the WebSphere Console by navigating through the following:

    Servers > Application servers > [app server name] > Process definition > Java Virtual Machine

    Under Generic JVM arguments, add the following:

    -Dlog4j.configuration=file:C:/log4j.properties

    Click Apply at the bottom of this page, and save your changes. This will require a restart of the application server to take effect.

提交回复
热议问题