You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Martin Všetička <vs...@gmail.com> on 2017/11/27 12:47:50 UTC

Fwd: Include location and performance

Hi,

I use Log4j2 with async logger and includeLocation=true. As the manual
warns, it slows down my application 4 times. Are there any tips how to
obtain location information without runtime performance hit?

* I use Java 9 so that Log4j2 can use the stack walking API but it
does not help too much.
* I was thinking about creating a script that modifies my source code
and adds the location information to all logging commands. That's the
only viable solution I see at the moment.
* There is also AspectJ technology that may be of use. However, my
last attempt to use the technology was a total disaster as my build
had never finished..

Does anyone have an idea?

Best regards,
Martin

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


Re: Fwd: Include location and performance

Posted by Mikael Ståldal <mi...@apache.org>.
If you use Scala, you could use macros.


On 2017-11-27 13:47, Martin Všetička wrote:
> Hi,
> 
> I use Log4j2 with async logger and includeLocation=true. As the manual
> warns, it slows down my application 4 times. Are there any tips how to
> obtain location information without runtime performance hit?
> 
> * I use Java 9 so that Log4j2 can use the stack walking API but it
> does not help too much.
> * I was thinking about creating a script that modifies my source code
> and adds the location information to all logging commands. That's the
> only viable solution I see at the moment.
> * There is also AspectJ technology that may be of use. However, my
> last attempt to use the technology was a total disaster as my build
> had never finished..
> 
> Does anyone have an idea?
> 
> Best regards,
> Martin

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