logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Markus Rechtien <recht...@dotquality.de>
Subject Re: Logging from java 5 dynamic proxy - method name within LocationInformation
Date Thu, 11 Oct 2007 09:45:08 GMT
Ok, I found out what can happen when just using
"indexOf" - when the logger class appears two
times in a row the logged method again is wrong
(the one of the second entry).

I am already using a cusom layout class and now
work around that problem by using a customized
location information class that looks up the
method and logger class directly from the throwable
stacktrace ...

/Markus

Antwort auf Markus Rechtien <rechtien@dotquality.de>:

> Hi,
>
> Im trying to use log4j with proxy classes and had the problem
> that I got the wrong method name within logging output when
> a classname exists more than one time within the stacktrace
> of the location information of the logging event.
>
> I took a look inside the code and found out, that the loggerclass
> is looked up with lastIndexOf within the string of the stacktrace.
> off course this is the reason why wrong method names appear
> in the logging output.
>
> Is there a reason why “indexOf” (first index of) can’t be used to look
> up the logger class in the stacktrace ?
>
>
> Many thanks and all the best,
>    Markus
>
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.



-- 

         [address]
         Markus Rechtien
         Rheiner Landstr. 83
         D-49078 Osnabrück

         [email]
         rechtien@dotquality.de

         [phone]
         +49 (0)541 3347736

         [cellular]
         +49 (0)176 22254427


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message