[logback-user] logback.xml not reloaded
Chris Pratt
thechrispratt at gmail.com
Tue Dec 2 22:50:13 CET 2014
I think you mean:
if (((invocationCounter++) % mask) == 0) {
Otherwise it will enter the block 15 out of 16 times (assuming the default
mask value of 16).
(*Chris*)
On Tue Dec 02 2014 at 1:44:44 PM Johanes Soetanto <otnateos at gmail.com>
wrote:
> Quoting the doc
>
> "In order to improve performance, ReconfigureOnChangeFilter is in reality
> "alive" only once every *N* logging operations. Depending on how often
> your application logs, the value of *N* can be modified on the fly by
> logback. By default N is 16, although it can go as high as 2^16 (= 65536)
> for CPU-intensive applications.
>
> In short, when a configuration file changes, it will be automatically
> reloaded but only after several logger invocations *and* after a delay
> determined by the scanning period.
> "
>
> Correct me if i'm wrong, if the check happens ever N log operation,
> shouldn't it use modulus instead of masking for the check?
>
> e.g.
>
> if (((invocationCounter++) % mask) != 0) {
>
>
> Thanks,
>
>
>
> Johanes
>
> On 2 December 2014 at 22:00, <logback-user-request at qos.ch> wrote:
>
>>
>>
>> ----------------------------------------------------------------------
>>
>> Message: 1
>> Date: Tue, 2 Dec 2014 17:05:05 +1100
>
>
>> From: Johanes Soetanto <otnateos at gmail.com>
>> To: logback-user at qos.ch
>> Subject:
>> Re: [logback-user] logback.xml not reloaded
>> Message-ID:
>>
> <
>> CAHn_Lrwmbson+n4zrRwHNQkEL-ch3BUGE5VvFMyykmnAwmqMHA at mail.gmail.com>
>> Content-Type: text/plain; charset="utf-8"
>
>
>>
>> Finally I manage to get a time to debug the app. Looking
>> into ReconfigureOnChangeFilter (version 1.0.13) , the execution is stopped
>> by line #108 where the mask is always set to 65535 .
>>
>> I'm clueless on how to change the mask as it seems like it is being
>> managed
>> automatically by updateMaskIfNecessary (line #147) . I believe it was
>> added
>> for optimization, but with mask value of 65535, it will be a while for the
>> configuration to be loaded even though i set my configuration to be
>> scanned
>> every 200 seconds.
>>
>> Any hint how to fix this? Thanks,
>>
>> Johanes
>>
>>
>> >
>> > Message: 1
>> > Date: Wed, 12 Nov 2014 12:10:38 +1100
>> > From: Johanes Soetanto <otnateos at gmail.com>
>> > To: logback-user at qos.ch
>> > Subject: Re: [logback-user] logback.xml not reloaded
>> > Message-ID:
>> > <CAHn_LrykvJuj=UF4=-YhoW+QdUb2y+iHKS9u=5wT5D=
>> > dCv8uNA at mail.gmail.com>
>> > Content-Type: text/plain; charset="utf-8"
>> >
>> > Upon my investigation, it seems like my problem with reloading is
>> related
>> > to the change made in version 1.0.2 (
>> http://jira.qos.ch/browse/LOGBACK-327
>> > ).
>> >
>> > I tested with version 1.0.1 or 1.1.2 the configuration is not reloaded
>> when
>> > there is change.
>> >
>> >
>> > Note: I haven't run the app on debug mode.
>> >
>> > Johanes
>> >
>> > >
>> > > Message: 4
>> > > Date: Tue, 4 Nov 2014 10:01:11 +0000
>> > > From: David Roussel <nabble at diroussel.xsmail.com>
>> > > To: logback users list <logback-user at qos.ch>
>> > > Subject:
>> > Re: [logback-user] logback.xml not reloaded
>> > > Message-ID:
>> > > <EEBB841D-A28F-4616-80CD-83E3A326CF70 at diroussel.xsmail.com>
>> > > Content-Type: text/plain; charset="us-ascii"
>> > >
>> > > My only suggestion is running it in a debugging session in your IDE
>> and
>> > > seeing what is happening that way.
>> > >
>> > > David
>> > >
>> > > > On 4 Nov 2014, at 07:34, Johanes Soetanto <otnateos at gmail.com>
>> wrote:
>> > > >
>> > > > Hi there,
>> > > >
>> > > > I would like to know if there is a way to debug why logback.xml
>> > > configuration change cannot be reloaded by our application. It had
>> been
>> > > working correctly on our application for a long time, however I
>> discover
>> > > from a week ago that change at runtime is not applied. If i restart
>> the
>> > > application, the change is applied properly. configuration xml is
>> using
>> > > basic one using scan="true".
>> > > >
>> > > > I tried adding debug="true" but no information message apart from
>> usual
>> > > logback information message before application startup. The only
>> change I
>> > > can think of is we change Tomcat from 6.0.x to 7.0.56. We are using
>> > logback
>> > > version 1.0.13.
>> > > >
>> > > > Any assistance is appreciated.
>> > > >
>> > > > Thanks
>> > > >
>> > > > Johanes
>> > > >
>>
> _______________________________________________
> Logback-user mailing list
> Logback-user at qos.ch
> http://mailman.qos.ch/mailman/listinfo/logback-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20141202/36c74974/attachment.html>
More information about the Logback-user
mailing list