Search code examples
log4j2websphere-8system-properties

setting Log4j2 Config file path through system variable in IBM Websphere 8.5


I am using IBM Webspehere 8.5, where i need to pass the the log4j2 config file path externally (not hardcoded in deployed jar file as for dev, uat and prod different config file are present)

Log4j2 site tells https://logging.apache.org/log4j/2.0/faq.html

You can also specify the full path of the configuration file with this system property: -Dlog4j.configurationFile=path/to/log4j2.xml

IBM WS site tells how to set it (But is it system property or environment variable) http://www-01.ibm.com/support/docview.wss?uid=swg21254153

Also . Can you please let me know the right way to set Log4j2 system property.


Solution

  • See the Java virtual machine custom properties topic in the Knowledge Center for information on setting JVM system properties:

    To set custom properties, connect to the administrative console and navigate to the appropriate Java virtual machine custom properties page.

    Application Server

    Click Servers > Server Types, and either WebSphere application servers > server_name or WebSphere proxy servers > server_name. Then, under Server Infrastructure, click Java and process management > Process definition > Java virtual machine > Custom properties.