<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Hi, Is there any way to get from MyLayout the logger level? I don't want to do this:<div><br></div><div><div>package com.render;</div><div><span style="font-size: 12pt;">import org.slf4j.LoggerFactory;</span></div><div><span style="font-size: 12pt;">import ch.qos.logback.classic.Logger;</span></div><div>import ch.qos.logback.classic.spi.ILoggingEvent;</div><div>import ch.qos.logback.core.LayoutBase;</div><div><br></div><div>import com.render.domain.Employee;</div><div><br></div><div>public class MyLayout extends LayoutBase<ILoggingEvent>{</div><div><span class="Apple-tab-span" style="white-space:pre">   </span></div><div><span class="Apple-tab-span" style="white-space:pre">             </span><b>String level= ((Logger)LoggerFactory.getLogger("employee")).getLevel().toString();</b></div><div>...</div><div>...</div><div><br></div><div>This works well but i don't like to instantiate an object just to get a logger level.</div><div><br></div><div><br></div><div>This is my xml config file:</div><div><br></div><div><div><span style="font-size: 12pt;"><configuration></span></div><div><span style="font-size: 12pt;"><logger name="employee" level="debug"/></span></div><div><span class="Apple-tab-span" style="font-size: 12pt; white-space: pre;">      </span><span style="font-size: 12pt;"><appender name="CONSOLE" </span><span style="font-size: 12pt;">class="ch.qos.logback.core.ConsoleAppender"></span></div><div><span class="Apple-tab-span" style="white-space:pre">         </span><encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder"></div><div>      <span class="Apple-tab-span" style="white-space:pre">             </span><layout class="com.render.MyLayout"  ></div><div>      <span class="Apple-tab-span" style="white-space:pre">             </span></layout></div><div>    <span class="Apple-tab-span" style="white-space:pre">        </span></encoder></div><div>    </appender><span class="Apple-tab-span" style="white-space:pre">      </span></div><div><span class="Apple-tab-span" style="white-space:pre">     </span></div><div><span class="Apple-tab-span" style="white-space:pre">     </span><root level="off"></div><div><span class="Apple-tab-span" style="white-space:pre">           </span><appender-ref ref="CONSOLE" /></div><div><span class="Apple-tab-span" style="white-space:pre">       </span></root></div><div></configuration></div><div><br></div></div><div><br></div><div>Thanks,</div><div>Gastón.</div><div><br></div></div>                                        </div></body>
</html>