In Tomcat 8.5.54, the following commit was added: https://github.com/apache/tomcat/commit/dcf3193bd6a293492fb7efe756827aece33f4a51 This uses the syntax ${foo:bar} to mean "If 'foo' is undefined, replace with 'bar'" Log4j2 has a feature called "property substitution": http://logging.apache.org/log4j/2.x/manual/configuration.html#PropertySubstitution http://logging.apache.org/log4j/log4j-2.12.1/manual/lookups.html For example, ${env:fooConfDir} is replaced with the value of the environment variable "fooConfDir". Due to the commit in 8.5.54, ${env:fooConfDir} instead now gets replaced with the literal value "fooConfDir" (assuming no variable named "env" is defined). In our case, we have the following lines in our web.xml (redacted): <context-param> <param-name>log4jConfiguration</param-name> <param-value>file://${env:fooConfDir}/foo/log4j2.xml</param-value> </context-param> As of Tomcat 8.5.54, Log4j fails to find its configuration file with the following error: ERROR StatusLogger Unable to access file://fooConfDir/foo/log4j2.xml java.net.UnknownHostException: fooConfDir It appears that the new syntax linked above interferes with Log4j's property substitution. Recommend changing the "default" syntax to ${foo:-bar} as this is also the syntax used by Log4j: https://logging.apache.org/log4j/2.x/manual/configuration.html#DefaultProperties
I don't like that the change in default format isn't backwards compatible but given the popularity of log4j2 and that the Tomcat feature is relatively new, I think this is the right thing to do.
Ok, this is unfortunate. Or maybe this feature could be skipped in some cases [with an option, skip by default], like for web.xml and the user descriptors ? To be honest, it is rather bad to do any property replacement at all there as it makes the webapp non portable. If it is kept, I don't really like ":-" as it's not intuitive, is "::" possible instead ?
${variable:-default} syntax is also used by bash/sh: https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html
I would also recommend to use :-. This shell/bsah default. Logback uses the same style.
Ok for ":-" then. This will be in 10.0-M5, 9.0.35, 8.5.55, 7.0.104.
Thank you for resolving this so quickly!
Another vote in favor of ":-"