birthTime of the context

Hi Joern,
Could you reset the birthTime of the Context as I requested in LBCLASSIC-273? Please? :)
The birth time of the context designates the start time of the application (assuming logback was started at application launch). I don't think it makes sense to reset the birth time when the context is reset. For example, relative time would go backwards if birth time was reset which users may find confusing. -- Ceki http://twitter.com/#!/ceki

Good point... I need the time of the last reset in some way so I'm able to only evaluate status messages since the last reset in an easy, straightforward way. How about adding another attribute for that instead, like e.g. resetTime, that would be initialized to birthTime initially but would be updated at the start of the reset operation. Would that be a reasonable compromise? On 26.10.2011, at 09:09, ceki wrote:
Hi Joern,
Could you reset the birthTime of the Context as I requested in LBCLASSIC-273? Please? :)
The birth time of the context designates the start time of the application (assuming logback was started at application launch). I don't think it makes sense to reset the birth time when the context is reset. For example, relative time would go backwards if birth time was reset which users may find confusing.
-- Ceki http://twitter.com/#!/ceki _______________________________________________ logback-dev mailing list logback-dev@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-dev

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? On 26/10/2011 11:19 AM, Joern Huxhorn wrote:
Good point...
I need the time of the last reset in some way so I'm able to only evaluate status messages since the last reset in an easy, straightforward way. How about adding another attribute for that instead, like e.g. resetTime, that would be initialized to birthTime initially but would be updated at the start of the reset operation.
Would that be a reasonable compromise?
On 26.10.2011, at 09:09, ceki wrote:
Hi Joern,
Could you reset the birthTime of the Context as I requested in LBCLASSIC-273? Please? :)
The birth time of the context designates the start time of the application (assuming logback was started at application launch). I don't think it makes sense to reset the birth time when the context is reset. For example, relative time would go backwards if birth time was reset which users may find confusing.
-- Ceki http://twitter.com/#!/ceki
-- -- Ceki http://twitter.com/#!/ceki

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?
On 26/10/2011 11:19 AM, Joern Huxhorn wrote:
Good point...
I need the time of the last reset in some way so I'm able to only evaluate status messages since the last reset in an easy, straightforward way. How about adding another attribute for that instead, like e.g. resetTime, that would be initialized to birthTime initially but would be updated at the start of the reset operation.
Would that be a reasonable compromise?
On 26.10.2011, at 09:09, ceki wrote:
Hi Joern,
Could you reset the birthTime of the Context as I requested in LBCLASSIC-273? Please? :)
The birth time of the context designates the start time of the application (assuming logback was started at application launch). I don't think it makes sense to reset the birth time when the context is reset. For example, relative time would go backwards if birth time was reset which users may find confusing.
-- Ceki http://twitter.com/#!/ceki
-- -- Ceki http://twitter.com/#!/ceki _______________________________________________ logback-dev mailing list logback-dev@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-dev

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?

I did not try it out, yet, but the code certainly looks like it serves my purpose. Thanks! Joern On 31.10.2011, at 21:46, ceki wrote:
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?
logback-dev mailing list logback-dev@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-dev
participants (2)
-
ceki
-
Joern Huxhorn