Re: log4j2 performance issues with Java 11

2020-11-20 Thread Matt Sicker
Yes, the network lookup thing is a startup bug that only happens once per JVM startup (or at least until its internal DNS caching expires which by default doesn't expire until you restart the JVM). On Fri, 20 Nov 2020 at 12:14, Lisa Ruby wrote: > > Hi Matt, > > Thank you for the input. I'm thinki

Re: log4j2 performance issues with Java 11

2020-11-20 Thread Lisa Ruby
Hi Matt, Thank you for the input. I'm thinking this isn't relevant in my case. Does this only happen when the JVM first starts up? The areas where I am logging the most and where I see the big performance hit, are actually after the application and log4j have started. I called it startup, but

Re: Reusing a PatternLayout pattern across several config files

2020-11-20 Thread Matt Sicker
Another alternative is to use the Java DSL: https://logging.apache.org/log4j/2.x/manual/customconfig.html Then you can reuse normal variables when setting values. On Fri, 20 Nov 2020 at 09:43, Stig Rohde Døssing wrote: > > Thank you, did not know about RoutingAppender. Will definitely look into

Re: Reusing a PatternLayout pattern across several config files

2020-11-20 Thread Stig Rohde Døssing
Thank you, did not know about RoutingAppender. Will definitely look into that. Good to know that wrapping like this is a known pattern. On 2020/11/20 14:15:53, Matt Sicker wrote: > That plug-in wrapper pattern will always work. Maybe creating properties to> > reference as variables is an option?

Re: log4j2 performance issues with Java 11

2020-11-20 Thread Matt Sicker
For startup time issues, there's also a Java "bug"/feature where if you don't have an /etc/hosts entry for localhost, InetAddress does a reverse name lookup on the loopback socket which ends up performing a network request on some operating systems (macOS seems to attempt an mDNS lookup of some sor

Re: Reusing a PatternLayout pattern across several config files

2020-11-20 Thread Matt Sicker
That plug-in wrapper pattern will always work. Maybe creating properties to reference as variables is an option? There might be a way to structure your configuration to use routing appenders or something like that to minimize duplication, too. On Fri, Nov 20, 2020 at 05:07 Stig Rohde Døssing wrot

Reusing a PatternLayout pattern across several config files

2020-11-20 Thread Stig Rohde Døssing
Hi, I have an application that ships with a number of config files included. We have a PatternLayout pattern that is used across all configurations, since our application needs to parse logs from that certain logs. We currently copy-paste the pattern to each file. I took a look at using propertie