<div dir="ltr">I'm not sure as there is no DTD for logback.xml due to the complexity of it.  It probably reconfigures the root logger for each element it sees, but I'm really not going to dig through the code to confirm that.<div><br></div><div>If you look at <a href="https://logback.qos.ch/manual/configuration.html#syntax">Chp 3 Configuration Syntax</a>, you'll notice a diagram explaining the high-level elements and their cardinality within the configuration file with only a single root element.</div><div><br></div><div><img src="https://logback.qos.ch/manual/images/chapters/configuration/basicSyntax.png" width="297" height="143"></div><div><br></div><div>Chp 7 Filters has an entry on <a href="https://logback.qos.ch/manual/filters.html#thresholdFilter">ThresholdFilter filter</a>, which is exactly what you need.<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 27, 2017 at 8:40 AM, Thomas Grainger <span dir="ltr"><<a href="mailto:tagrain@gmail.com" target="_blank">tagrain@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">ah ok, why did my application boot with the first configuration? Is that a logback bug?<span class="HOEnZb"><font color="#888888"><br></font></span></div><div class="gmail_extra"><span class="HOEnZb"><font color="#888888"><br clear="all"><div><div class="m_-6625114930600025106gmail_signature" data-smartmail="gmail_signature">Thomas Grainger</div></div></font></span><div><div class="h5">
<br><div class="gmail_quote">On 27 March 2017 at 13:39, Andrew Feller <span dir="ltr"><<a href="mailto:afeller@bandwidth.com" target="_blank">afeller@bandwidth.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">You can only have a single root element.  If you want to filter log events by severity / priority by appender, then you should use the ThresholdFilter filter per appender.</div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_-6625114930600025106h5">On Mon, Mar 27, 2017 at 4:42 AM, Thomas Grainger <span dir="ltr"><<a href="mailto:tagrain@gmail.com" target="_blank">tagrain@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_-6625114930600025106h5"><div dir="ltr"><div><div>I have a config file:<br><br><configuration><br><br>  <conversionRule conversionWord="coloredLevel" converterClass="play.api.Logge<wbr>r$ColoredLevel" /><br>  <contextListener class="com.procensus.backend.l<wbr>ogging.LoggerStartupListener"/<wbr>><br><br>  <appender name="FILE" class="ch.qos.logback.core.Fil<wbr>eAppender"><br>     <file>${application.home}/logs<wbr>/application.log</file><br>     <encoder><br>       <pattern>%date - [%level] - from %logger in %thread %n%message%n%xException%n</pat<wbr>tern><br>     </encoder><br>   </appender><br><br>  <appender name="STDOUT" class="ch.qos.logback.core.Con<wbr>soleAppender"><br>    <encoder><br>      <pattern>%coloredLevel %logger{15} - %message%n%xException{5}</patt<wbr>ern><br>    </encoder><br>  </appender><br><br>  <appender name="CLOUDWATCH_SYNC" class="ca.pjer.logback.AwsLogs<wbr>Appender"><br>      <logRegion>eu-west-1</logRegio<wbr>n><br>      <logGroupName>procensus/backen<wbr>d</logGroupName><br>      <logStreamName>${EC2_METADATA_<wbr>IP_ADDRESS}</logStreamName><br>      <layout class="ch.qos.logback.contrib.<wbr>json.classic.JsonLayout"><br>          <jsonFormatter class="ch.qos.logback.contrib.<wbr>jackson.JacksonJsonFormatter"><br>              <prettyPrint>false</prettyPrin<wbr>t><br>          </jsonFormatter><br>      </layout><br>  </appender><br><br>  <appender name="CLOUDWATCH" class="ch.qos.logback.classic.<wbr>AsyncAppender"><br>      <appender-ref ref="CLOUDWATCH_SYNC"/><br>  </appender><br><br>  <appender name="SENTRY" class="com.getsentry.raven.log<wbr>back.SentryAppender"><br>    <dsn><a href="https://redacted:redacted@sentry.io/redacted" target="_blank">https://redacted:redacted<wbr>@sentry.io/redacted</a></dsn><br>  </appender><br><br>  <logger name="play" level="INFO" /><br>  <logger name="application" level="DEBUG" /><br><br>  <!-- Off these ones as they are annoying, and anyway we manage configuration ourself --><br>  <logger name="com.avaje.ebean.config.P<wbr>ropertyMapLoader" level="OFF" /><br>  <logger name="com.avaje.ebeaninternal.<wbr>server.core.XmlConfigLoader" level="OFF" /><br>  <logger name="com.avaje.ebeaninternal.<wbr>server.lib.BackgroundThread" level="OFF" /><br>  <logger name="com.gargoylesoftware.htm<wbr>lunit.javascript" level="OFF" /><br>  <logger name="com.amazonaws.request" level="OFF" /><br><br>  <root level="ERROR"><br>    <appender-ref ref="STDOUT" /><br>    <appender-ref ref="FILE" /><br>  </root><br><br>  <root level="INFO"><br>    <appender-ref ref="CLOUDWATCH" /><br>  </root><br><br>  <root level="WARN"><br>    <appender-ref ref="SENTRY" /><br>  </root><br><br></configuration><br><br></div>However, even though I have root level="WARN" for Sentry, I get all logging events (eg INFO level)<br><br><br><br></div>When I configure a filter, my process doesn't even boot, with no error message at all:<br><br><br><configuration><br><br>  <conversionRule conversionWord="coloredLevel" converterClass="play.api.Logge<wbr>r$ColoredLevel" /><br>  <contextListener class="com.procensus.backend.l<wbr>ogging.LoggerStartupListener"/<wbr>><br><br>  <appender name="FILE" class="ch.qos.logback.core.Fil<wbr>eAppender"><br>     <file>${application.home}/logs<wbr>/application.log</file><br>     <encoder><br>       <pattern>%date - [%level] - from %logger in %thread %n%message%n%xException%n</pat<wbr>tern><br>     </encoder><br>   </appender><br><br>  <appender name="STDOUT" class="ch.qos.logback.core.Con<wbr>soleAppender"><br>    <encoder><br>      <pattern>%coloredLevel %logger{15} - %message%n%xException{5}</patt<wbr>ern><br>    </encoder><br>  </appender><br><br>  <appender name="CLOUDWATCH_SYNC" class="ca.pjer.logback.AwsLogs<wbr>Appender"><br>      <logRegion>eu-west-1</logRegio<wbr>n><br>      <logGroupName>procensus/backen<wbr>d</logGroupName><br>      <logStreamName>${EC2_METADATA_<wbr>IP_ADDRESS}</logStreamName><br>      <layout class="ch.qos.logback.contrib.<wbr>json.classic.JsonLayout"><br>          <jsonFormatter class="ch.qos.logback.contrib.<wbr>jackson.JacksonJsonFormatter"><br>              <prettyPrint>false</prettyPrin<wbr>t><br>          </jsonFormatter><br>      </layout><br>  </appender><br><br>  <appender name="CLOUDWATCH" class="ch.qos.logback.classic.<wbr>AsyncAppender"><br>      <appender-ref ref="CLOUDWATCH_SYNC"/><br>  </appender><br><br>  <appender name="SENTRY" class="com.getsentry.raven.log<wbr>back.SentryAppender"><br>    <dsn><a href="https://redacted:redacted@sentry.io/redacted" target="_blank">https://redacted:redacted<wbr>@sentry.io/redacted</a></dsn><br>    <filter class="ch.qos.logback.classic.<wbr>filter.ThresholdFilter"><br>      <level>WARN</level><br>    </filter><br>  </appender><br><br>  <logger name="play" level="INFO" /><br>  <logger name="application" level="DEBUG" /><br><br>  <!-- Off these ones as they are annoying, and anyway we manage configuration ourself --><br>  <logger name="com.avaje.ebean.config.P<wbr>ropertyMapLoader" level="OFF" /><br>  <logger name="com.avaje.ebeaninternal.<wbr>server.core.XmlConfigLoader" level="OFF" /><br>  <logger name="com.avaje.ebeaninternal.<wbr>server.lib.BackgroundThread" level="OFF" /><br>  <logger name="com.gargoylesoftware.htm<wbr>lunit.javascript" level="OFF" /><br>  <logger name="com.amazonaws.request" level="OFF" /><br><br>  <root level="ERROR"><br>    <appender-ref ref="STDOUT" /><br>    <appender-ref ref="FILE" /><br>  </root><br><br>  <root level="INFO"><br>    <appender-ref ref="CLOUDWATCH" /><br>  </root><br><br>  <root level="WARN"><br>    <appender-ref ref="SENTRY" /><br>  </root><br><br></configuration><span class="m_-6625114930600025106m_7877648373222611593HOEnZb"><font color="#888888"><br><div><br clear="all"><div><div><div><div class="m_-6625114930600025106m_7877648373222611593m_-8790679302490206066gmail_signature">Thomas Grainger</div></div>
</div></div></div></font></span></div>
<br></div></div>______________________________<wbr>_________________<br>
logback-user mailing list<br>
<a href="mailto:logback-user@qos.ch" target="_blank">logback-user@qos.ch</a><br>
<a href="http://mailman.qos.ch/mailman/listinfo/logback-user" rel="noreferrer" target="_blank">http://mailman.qos.ch/mailman/<wbr>listinfo/logback-user</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="m_-6625114930600025106m_7877648373222611593gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><table style="font-size:12.8px;border:none;border-collapse:collapse"><tbody><tr style="height:167px"><td style="border:1px solid rgb(255,255,255);vertical-align:top;padding:7px"><p dir="ltr" style="line-height:1.44;margin-top:0pt;margin-bottom:0pt;margin-right:5pt"><font size="1"><span style="font-family:Arial;color:rgb(0,0,0);font-weight:700;vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><img src="https://lh6.googleusercontent.com/WYeu84rijHA9DnlNpowhtHIkbXm-fNOEmMXbaM9QdZOpIs8fXg7mfWjQ44WzQz6JgcptFWq4MSjLu-CIhdcEU75IPR-FelHpEoMX7jU_h1S4hvD2TOOijrQlNW0Wts7MBstczHU" alt="email-signature-logo.jpg" style="border:none" width="96" height="82"></span></font></p></td><td style="border:1px solid rgb(255,255,255);vertical-align:top;padding:7px"><p dir="ltr" style="margin-top:0pt;margin-bottom:0pt"><font size="2" color="#676767" face="Calibri"><span style="line-height:14.08px;white-space:pre-wrap"><b>Andy Feller</b></span></font></p><p dir="ltr" style="line-height:1.2;margin-top:0pt;margin-bottom:0pt"><font size="2"><span style="font-family:Calibri;color:rgb(132,139,148);font-style:italic;vertical-align:baseline;white-space:pre-wrap">Sr. DevOps Engineer<br></span><span style="font-family:Calibri;color:rgb(132,139,148);vertical-align:baseline;white-space:pre-wrap">900 Main Campus Drive, Suite 500</span></font></p><p dir="ltr" style="line-height:1.2;margin-top:0pt;margin-bottom:0pt"><span style="font-family:Calibri;color:rgb(132,139,148);vertical-align:baseline;white-space:pre-wrap"><font size="2">Raleigh, NC 27606</font></span></p><p dir="ltr" style="line-height:1.2;margin-top:0pt;margin-bottom:0pt"><font size="2"><span style="color:rgb(25,98,207);text-decoration:underline;font-family:Calibri;vertical-align:baseline;white-space:pre-wrap"><a href="http://www.bandwidth.com/" style="color:rgb(17,85,204);text-decoration:none" target="_blank">Bandwidth</a></span><a href="http://www.bandwidth.com/" target="_blank"><span style="color:rgb(103,103,103);text-decoration:none;font-family:Calibri;font-weight:700;vertical-align:baseline;white-space:pre-wrap"><br></span></a></font><span style="font-size:small;line-height:1.2;font-family:Calibri;color:rgb(103,103,103);font-weight:700;vertical-align:baseline;white-space:pre-wrap">e</span><span style="font-size:small;line-height:1.2;font-family:Calibri;color:rgb(128,128,128);vertical-align:baseline;white-space:pre-wrap"> </span><a href="mailto:afeller@bandwidth.com" style="font-size:small;line-height:1.2;color:rgb(17,85,204);text-decoration:none" target="_blank"><span style="font-family:Calibri;text-decoration:underline;vertical-align:baseline;white-space:pre-wrap">afeller@bandwidth.com</span></a></p></td></tr></tbody></table></div></div></div></div>
</div>
<br>______________________________<wbr>_________________<br>
logback-user mailing list<br>
<a href="mailto:logback-user@qos.ch" target="_blank">logback-user@qos.ch</a><br>
<a href="http://mailman.qos.ch/mailman/listinfo/logback-user" rel="noreferrer" target="_blank">http://mailman.qos.ch/mailman/<wbr>listinfo/logback-user</a><br></blockquote></div><br></div></div></div>
<br>______________________________<wbr>_________________<br>
logback-user mailing list<br>
<a href="mailto:logback-user@qos.ch">logback-user@qos.ch</a><br>
<a href="http://mailman.qos.ch/mailman/listinfo/logback-user" rel="noreferrer" target="_blank">http://mailman.qos.ch/mailman/<wbr>listinfo/logback-user</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><table style="font-size:12.8px;border:none;border-collapse:collapse"><tbody><tr style="height:167px"><td style="border:1px solid rgb(255,255,255);vertical-align:top;padding:7px"><p dir="ltr" style="line-height:1.44;margin-top:0pt;margin-bottom:0pt;margin-right:5pt"><font size="1"><span style="font-family:Arial;color:rgb(0,0,0);font-weight:700;vertical-align:baseline;white-space:pre-wrap;background-color:transparent"><img src="https://lh6.googleusercontent.com/WYeu84rijHA9DnlNpowhtHIkbXm-fNOEmMXbaM9QdZOpIs8fXg7mfWjQ44WzQz6JgcptFWq4MSjLu-CIhdcEU75IPR-FelHpEoMX7jU_h1S4hvD2TOOijrQlNW0Wts7MBstczHU" width="96" height="82" alt="email-signature-logo.jpg" style="border:none"></span></font></p></td><td style="border:1px solid rgb(255,255,255);vertical-align:top;padding:7px"><p dir="ltr" style="margin-top:0pt;margin-bottom:0pt"><font color="#676767" face="Calibri" size="2"><span style="line-height:14.08px;white-space:pre-wrap"><b>Andy Feller</b></span></font></p><p dir="ltr" style="line-height:1.2;margin-top:0pt;margin-bottom:0pt"><font size="2"><span style="font-family:Calibri;color:rgb(132,139,148);font-style:italic;vertical-align:baseline;white-space:pre-wrap">Sr. DevOps Engineer<br></span><span style="font-family:Calibri;color:rgb(132,139,148);vertical-align:baseline;white-space:pre-wrap">900 Main Campus Drive, Suite 500</span></font></p><p dir="ltr" style="line-height:1.2;margin-top:0pt;margin-bottom:0pt"><span style="font-family:Calibri;color:rgb(132,139,148);vertical-align:baseline;white-space:pre-wrap"><font size="2">Raleigh, NC 27606</font></span></p><p dir="ltr" style="line-height:1.2;margin-top:0pt;margin-bottom:0pt"><font size="2"><span style="color:rgb(25,98,207);text-decoration:underline;font-family:Calibri;vertical-align:baseline;white-space:pre-wrap"><a href="http://www.bandwidth.com/" style="color:rgb(17,85,204);text-decoration:none" target="_blank">Bandwidth</a></span><a href="http://www.bandwidth.com/" target="_blank"><span style="color:rgb(103,103,103);text-decoration:none;font-family:Calibri;font-weight:700;vertical-align:baseline;white-space:pre-wrap"><br></span></a></font><span style="font-size:small;line-height:1.2;font-family:Calibri;color:rgb(103,103,103);font-weight:700;vertical-align:baseline;white-space:pre-wrap">e</span><span style="font-size:small;line-height:1.2;font-family:Calibri;color:rgb(128,128,128);vertical-align:baseline;white-space:pre-wrap"> </span><a href="mailto:afeller@bandwidth.com" style="font-size:small;line-height:1.2;color:rgb(17,85,204);text-decoration:none" target="_blank"><span style="font-family:Calibri;text-decoration:underline;vertical-align:baseline;white-space:pre-wrap">afeller@bandwidth.com</span></a></p></td></tr></tbody></table></div></div></div></div>
</div></div>