I'm already successfully configuring Log4J 2 with a log4j2.xml
file, and I'm successfully setting the value of a Property
in the file via a
JNDI variable lookup.
However, I'd like to provide a default value for the Property
if the JNDI variable doesn't exist.
Is this possible?
Try this:
<Root level="${jndi:yourJndiVariableName:-DEFAULT}">
Generally all Log4j2 lookups follow this pattern: ${type:key:-defaultValue}
.