<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">You really didn't provide enough information on what you are trying to accomplish. What you are trying to do is filter what events are logged. You could accomplish that by using Markers, multiple loggers, or a configurable TurboFilter (the turbo filter can inspect the method name of the caller). <div><br></div><div>Ralph</div><div><br><div><div>On Sep 20, 2010, at 7:21 AM, <a href="mailto:marc.baumgartner@degussa-bank.de">marc.baumgartner@degussa-bank.de</a> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><font size="2" face="sans-serif">Hi all,</font>
<br>
<br><font size="2" face="sans-serif">is there a possibility to log depending
on the class or method? For example I have the following scenario:</font>
<br>
<br><font size="2" face="sans-serif">package a.b.c</font>
<br>
<br><font size="2" face="sans-serif">public Class D{</font>
<br>
<br><font size="2" face="sans-serif"> Logger
logger = LoggerFactory.getLogger(D.class);</font>
<br>
<br><font size="2" face="sans-serif"> public
void method1(){</font>
<br><font size="2" face="sans-serif">
<a href="http://logger.info">logger.info</a>("method1");</font>
<br><font size="2" face="sans-serif"> }</font>
<br>
<br><font size="2" face="sans-serif"> public
void method2(){</font>
<br><font size="2" face="sans-serif">
<a href="http://logger.info">logger.info</a>("method2");</font>
<br><font size="2" face="sans-serif"> }</font>
<br><font size="2" face="sans-serif">}</font>
<br>
<br><font size="2" face="sans-serif">I look for something like this in logback
configuration:</font>
<br>
<br><font size="2" color="#008080" face="Courier New"><</font><font size="2" color="#3f8080" face="Courier New">logger</font><font size="2" face="Courier New">
</font><font size="2" color="#800080" face="Courier New">name</font><font size="2" face="Courier New">=</font><font size="2" color="#4200ff" face="Courier New"><i>"a.b.c.D#method1"</i></font><font size="2" face="Courier New">
</font><font size="2" color="#800080" face="Courier New">level</font><font size="2" face="Courier New">=</font><font size="2" color="#4200ff" face="Courier New"><i>"INFO"</i></font><font size="2" face="Courier New">
</font><font size="2" color="#008080" face="Courier New">/></font>
<br>
<br><font size="2" color="#008080" face="Courier New"><</font><font size="2" color="#3f8080" face="Courier New">root</font><font size="2" face="Courier New">
</font><font size="2" color="#800080" face="Courier New">level</font><font size="2" face="Courier New">=</font><font size="2" color="#4200ff" face="Courier New"><i>"WARN"</i></font><font size="2" color="#008080" face="Courier New">></font>
<br><font size="2" color="#008080" face="Courier New"></root></font>
<br>
<br>
<br><font size="2" color="#008080" face="Courier New">After calling method1
and method2 I would expect only the log entry of method 2.</font>
<br>
<br><font size="2" color="#008080" face="Courier New">Is this possible?</font>
<br>
<br><font size="2" color="#008080" face="Courier New">Thanks & regards,</font>
<br><font size="2" color="#008080" face="Courier New">Marc</font>
<br>_______________________________________________<br>Logback-user mailing list<br><a href="mailto:Logback-user@qos.ch">Logback-user@qos.ch</a><br>http://qos.ch/mailman/listinfo/logback-user<br></blockquote></div><br></div></body></html>