Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"else if" in janino logback configuration

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>
like image 744
N.. Avatar asked Oct 16 '25 22:10

N..


1 Answers

Try to do like this.

<if condition=''>
  <then>..</then>
  <else>
    <if condition=''>
      <then>..</then>
      <else>..</else>
    </if>
  </else>
</if>
like image 136
Jungyeol Avatar answered Oct 21 '25 11:10

Jungyeol