[logback-dev] birthTime of the context

ceki ceki at qos.ch
Mon Oct 31 21:46:36 CET 2011


Hi Joern,

Just added timeOfLastReset method to StatusChecker. See
http://github.com/ceki/logback/commit/f28496ad3e5c63 for details.

Let me know if it all fits together.
-- 
Ceki
http://twitter.com/#!/ceki

On 26/10/2011 12:09 PM, Joern Huxhorn wrote:
> Yes, it would.
>
> Are you planning to check for the "Will reset and reconfigure context"?
> That wouldn't be very efficient... on the other hand, this isn't code where efficiency is really important.
>
> I'd much prefer to have such a method in your codebase since it would be your task to fix it if the above message would ever change in the future. I'm not very fond of checking for externally defined "magic" string constants in my own code.
> Also, if you'd ever add such a resetTime property in the future, you could simply change the implementation of the timeOfLastReset() method to evaluate that property instead of parsing the status messages.
>
> So yes, I'd be very fine with that proposal.
>
> On 26.10.2011, at 11:26, ceki wrote:
>
>> How about if there was a method which returned the time of the last reset? Something like:
>>
>> StatusChecker checker = new StatusChercker(loggerContext);
>> long time = checker.timeOfLastReset();
>>
>> Would the above work for you?


More information about the logback-dev mailing list