Although the Java project I'm working with contains different jconfig XML files per environment, it has one logback XML file for the entire project.
Inside, there is an SMTPAppender like:
<appender name="ERROR_EMAIL" class="ch.qos.logback.classic.net.SMTPAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>ERROR</level>
</filter>
<SMTPHost>${logs.smtp.host}</SMTPHost>
<To>@abc.com</To>
<From>123@abc.com</From>
<Subject>[Error occurred in ${environment}</Subject>
</appender>
As you see, access to the environment variable is available so can this be utilized to only send this ERROR_EMAIL in certain environments?
Thank you very much for your time!