<div dir="ltr">Well, I see three ways you can do this:<div><br></div><div>1. Enable location information in the pattern layout. This is slow, however, but so is using java.util.logging instead.</div><div>2. Since you're already using Log4j 2, you can use log4j-api's Logger.traceEntry() and Logger.traceExit() methods <<a href="https://logging.apache.org/log4j/2.x/log4j-api/apidocs/org/apache/logging/log4j/Logger.html#traceEntry()">https://logging.apache.org/log4j/2.x/log4j-api/apidocs/org/apache/logging/log4j/Logger.html#traceEntry()</a>>.</div><div>3. Emulate the tracing functionality by just using Logger.trace() with markers for entry/exit.</div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-02-13 7:57 GMT-06:00 CARTEREAU Benjamin <span dir="ltr"><<a href="mailto:benjamin.cartereau@cnav.fr" target="_blank">benjamin.cartereau@cnav.fr</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
I would like to log method entry/exit with slf4j through an Interceptor that knows the name of the called/intercepted method.<br>
I have found out that XLogger makes it possible to log that kind of activity (entry/exit of a method) but the method name cannot be specified.<br>
And since I am in an interceptor class and not the real class/method, I cannot rely on my logging implementation (log4j2) that could output the method name where the logging request was issued.<br>
Is there a way to accomplish this (like it is possible through JUL  entering/exiting methods) or could it require XLogger evolutions ?<br>
<br>
Regards<br>
******************************<wbr>******************************<wbr>*****************************<br>
<br>
<br>
Ce message électronique, les éventuels fichiers joints et les informations qu'il contient, peuvent être couverts par le secret professionnel et sont exclusivement adressés à son destinataire. Si vous le recevez par erreur, merci d'en informer l'expéditeur et de le détruire. A ce titre, toute diffusion non autorisée de ce message, même partielle, sous quelque forme que ce soit, est interdite et punie par la loi.<br>
<br>
En aucun cas, le contenu de ce message ne peut valoir offre ou acceptation ou engagement de la part de la CNAV.<br>
<br>
Les opinions contenues dans ce message sont personnelles à l'émetteur.<br>
<br>
Il est de la responsabilité du destinataire de s'assurer que le message et ses éventuelles pièces jointes ne contiennent pas de virus informatique.<br>
______________________________<wbr>_________________<br>
slf4j-user mailing list<br>
<a href="mailto:slf4j-user@qos.ch">slf4j-user@qos.ch</a><br>
<a href="http://mailman.qos.ch/mailman/listinfo/slf4j-user" rel="noreferrer" target="_blank">http://mailman.qos.ch/mailman/<wbr>listinfo/slf4j-user</a></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Matt Sicker <<a href="mailto:boards@gmail.com" target="_blank">boards@gmail.com</a>></div>
</div>