I am trying to use janino conditional statements in logback configuration and it is working fine with "if" and "else". But I want to ask if there is it possible to write "else if" in it?
My case -
<if condition='p("log.environment").equals("prod")'>
<then>
<include file="${LOG_CONFIG_DIR}/logback-prod.xml" />
</then>
</if>
<if condition='p("log.environment").equals("uat")'>
<then>
<include file="${LOG_CONFIG_DIR}/logback-uat.xml" />
</then>
</if>
<if condition='p("log.environment").equals("dev")'>
<then>
<include file="${LOG_CONFIG_DIR}/logback-dev.xml" />
</then>
</if>
Try to do like this.
<if condition=''>
<then>..</then>
<else>
<if condition=''>
<then>..</then>
<else>..</else>
</if>
</else>
</if>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With