Re: Compression of rolled files : performance issue when lots of JVMs are using timed based policy

2017-03-22 Thread Remko Popma
> On Mar 23, 2017, at 1:06, Anthony Maire wrote: > > Thanks for these answers > > @Ralph : that was the kind of idea I had in mind : changing the > RollingFileManager.asyncExecutor to be a ScheduledThreadPoolExecutor, and > based on some configuration, submitting task to be executed after a ran

Re: Display text when thread context is empty

2017-03-22 Thread Matt Sicker
I believe he's referencing this: https://logging.apache.org/log4j/2.x/manual/extending.html#Custom_ContextDataInjector On 22 March 2017 at 14:48, Christian wrote: > Thanks Matt and Ralph! > > I also thought if it is possible to use the %replace pattern for this > purpose. I think I will give th

Re: Display text when thread context is empty

2017-03-22 Thread Christian
Thanks Matt and Ralph! I also thought if it is possible to use the %replace pattern for this purpose. I think I will give this a try. @Ralph: What do you mean with "Data Injection stuff"? Do you have any link a documentation with information about this? Best regards, Christian Am 22.03

Re: Display text when thread context is empty

2017-03-22 Thread Matt Sicker
There's the %notEmpty{} pattern which only outputs its pattern if all its variables are not empty. If you want a default value, then perhaps combine that with %replace{%notEmpty{%X{userNumber}}}{^$}{fallback value} or something similar. You shouldn't need the %notEmpty{} bit if you don't add anythi

Re: log4j:WARN Attribute "additivity" must be declared for element type "appender-ref"

2017-03-22 Thread bmelloni
Thank you, that seemed to be it. I removed the additivity from appender-ref tags and the problem went away. I guess I got bit by a strangely worded error message. The way it was stated it seemed to say that I'd missed putting additivity on some appender-ref rather than having put one that didn

Re: Display text when thread context is empty

2017-03-22 Thread Ralph Goers
If userNumber does not exist in the ThreadContext then nothing will be included in the display. I am not aware that we have implemented any way to specify a default value for this, but with the Data Injection stuff that was added a few releases ago it might be possible. Ralph > On Mar 22, 201

Display text when thread context is empty

2017-03-22 Thread Christian
Hi all, with the pattern /%X{userNumber}/ I am able to display a value I stored in the thread context. Is there any possibilty to display an alternative value if nothing was found and/or an empty value was stored under the key I'm suing (in this case /userNumber/). Thanks and best regards

Re: log4j:WARN Attribute "additivity" must be declared for element type "appender-ref"

2017-03-22 Thread Matt Sicker
If the v1 config is anything like the v2 config, then you only need additivity="false" on the logger element (in this case, the element). The appender-ref element has nothing to do with additivity. On 22 March 2017 at 12:26, bmelloni wrote: > I thought I understood additivity, but apparently I

log4j:WARN Attribute "additivity" must be declared for element type "appender-ref"

2017-03-22 Thread bmelloni
I thought I understood additivity, but apparently I don't. I am using log4j-1.2.17.jar. After getting a bunch errors like the one in the subject I kept adding additivity tags, but nothing stopped the errors. What is the correct syntax to send the packages (and subpackages/classes) that have ap

Re: Compression of rolled files : performance issue when lots of JVMs are using timed based policy

2017-03-22 Thread Anthony Maire
Thanks for these answers @Ralph : that was the kind of idea I had in mind : changing the RollingFileManager.asyncExecutor to be a ScheduledThreadPoolExecutor, and based on some configuration, submitting task to be executed after a random delay. However with this kind of approach, special treatment

Re: Compression of rolled files : performance issue when lots of JVMs are using timed based policy

2017-03-22 Thread Ralph Goers
These are separate JVMs, so having a single executor would be of no help. I believe the only way to do what you are asking for is to add configuration so that the asynchronous thread has a semi-random delay when it starts. Ralph > On Mar 22, 2017, at 7:58 AM, Greg Thomas wrote: > >> One commo

Re: Compression of rolled files : performance issue when lots of JVMs are using timed based policy

2017-03-22 Thread Greg Thomas
>One common issue we have with that framework (and I assume we can have the >same with log4j2) is that all of our JVMs (we can have more than 50 JVMs on >the same server in production) roll their file at midnight. > >When this happens, the system became often not usable for a few seconds >because o

Re: Compression of rolled files : performance issue when lots of JVMs are using timed based policy

2017-03-22 Thread David Leonhartsberger
I think something like the following is possible Means that you specify that the rollover should happen at 12:00 but the seconds are kind of randomized via Property Substitution or so. Not sure if date:seconds works but alternatively you could use system or env variables for it i guess. Br, Davi

Re: Compression of rolled files : performance issue when lots of JVMs are using timed based policy

2017-03-22 Thread Matt Sicker
I'm not sure if the feature is in log4j, but that reminds me of the jenkins feature where you can do the same. I'd take a look at the cron triggering policy docs first to see what's already possible. You can also combine that with some scripts, so there's certainly a way to do it using current func

Compression of rolled files : performance issue when lots of JVMs are using timed based policy

2017-03-22 Thread Anthony Maire
Hi We are currently using another logging framework in production, but I'm pushing to change it for log4j2. One common issue we have with that framework (and I assume we can have the same with log4j2) is that all of our JVMs (we can have more than 50 JVMs on the same server in production) roll th