James Hutchinson
James Hutchinson

Reputation: 881

liberty profile configuration issue (log4j2)

I can successfully set up log4j logging by setting up the following line within my jvm.options file:

-Dlog4j.configurationFile=C:/eclipse/runtime/usr/servers/tmpServer/log4j2.xml

However, I want to change this, so the path is not hard coded.

I was hoping this would work:

-Dlog4j.configurationFile=${server.config.dir}/log4j2.xml

But it does not. Any ideas why not?

I'm using liberty profile, and my log4j2.xml file is in the same directory as the jvm.options file.

Upvotes: 1

Views: 1454

Answers (1)

Gas
Gas

Reputation: 18020

Shell and variable expansion are not supported in jvm.options - check this page Customizing the Liberty profile environment - however server.config.dir is default working directory so setting: -Dlog4j.configurationFile=./log4j2.xml should work.

Upvotes: 2

Related Questions