You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Gary Gregory <ga...@gmail.com> on 2015/07/31 22:49:27 UTC

Reconfiguration starvation

Hi All:

I have a case where I:
- start my app with INFO level logging
- wait an hour
- update and save the log4j config file (which already had
monitorInterval="5") to use DEBUG and Console logging in addition to the
already configured rolling file.
- no config changes seem to take effect.

I know the app is running with one thread and that thread is very busy
reading MBs upon MBs of data from a socket input stream, which I can
confirm my peeking at the app from VisualVM.

Would using a Java 7 file watchdog make reconfiguration more reliable?

Gary

-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: Reconfiguration starvation

Posted by Ralph Goers <ra...@dslextreme.com>.
Reconfiguration should take place if the file timestamp is newer than what it was at startup or the last reconfiguration.  It is only checked for once for every 16 log events written if the interval has expired.  If the app doesn’t write many events then it might not ever reconfigure. Using a watchdog would definitely fix that.

Ralph


> On Jul 31, 2015, at 1:49 PM, Gary Gregory <ga...@gmail.com> wrote:
> 
> Hi All:
> 
> I have a case where I:
> - start my app with INFO level logging
> - wait an hour
> - update and save the log4j config file (which already had monitorInterval="5") to use DEBUG and Console logging in addition to the already configured rolling file.
> - no config changes seem to take effect.
> 
> I know the app is running with one thread and that thread is very busy reading MBs upon MBs of data from a socket input stream, which I can confirm my peeking at the app from VisualVM.
> 
> Would using a Java 7 file watchdog make reconfiguration more reliable?
> 
> Gary
> 
> -- 
> E-Mail: garydgregory@gmail.com <ma...@gmail.com> | ggregory@apache.org  <ma...@apache.org>
> Java Persistence with Hibernate, Second Edition <http://www.manning.com/bauer3/>
> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> Spring Batch in Action <http://www.manning.com/templier/>
> Blog: http://garygregory.wordpress.com <http://garygregory.wordpress.com/> 
> Home: http://garygregory.com/ <http://garygregory.com/>
> Tweet! http://twitter.com/GaryGregory <http://twitter.com/GaryGregory>

Re: Reconfiguration starvation

Posted by Remko Popma <re...@gmail.com>.
While reading from the socket, is the app logging anything? The trigger for a reconfig is a log event...

Remko

Sent from my iPhone

> On 2015/08/01, at 5:49, Gary Gregory <ga...@gmail.com> wrote:
> 
> Hi All:
> 
> I have a case where I:
> - start my app with INFO level logging
> - wait an hour
> - update and save the log4j config file (which already had monitorInterval="5") to use DEBUG and Console logging in addition to the already configured rolling file.
> - no config changes seem to take effect.
> 
> I know the app is running with one thread and that thread is very busy reading MBs upon MBs of data from a socket input stream, which I can confirm my peeking at the app from VisualVM.
> 
> Would using a Java 7 file watchdog make reconfiguration more reliable?
> 
> Gary
> 
> -- 
> E-Mail: garydgregory@gmail.com | ggregory@apache.org 
> Java Persistence with Hibernate, Second Edition
> JUnit in Action, Second Edition
> Spring Batch in Action
> Blog: http://garygregory.wordpress.com 
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory