On 20.03.2014 22:35, Michael Reinhold wrote:Ok. Most likely you are right, such approach is useful for flexibility.
The intent of the shutdown hook functionality is not to be a general
application shutdown hook, but to provide reasonably ways of having
logback wait for a some condition before shutting down (not just calling
LoggerContext.stop immediately). Logback can provide one or more general
mechanisms for performing this action, however if the user's needs
differ they could implement their own.
Particularly if exotic appenders are used, like cloud logging services.
And user can select how logback should react to system-wide message
"JVM will be shutdown soon" - by completely shutting down logback
or just by flushing all memory buffers and switching logback
info fail-safe mode and continue logging.
I prefer switching into fail-safe transparent sync mode
to be the default, which guarantee flushing all events
from memory buffers and also allow subsequent events
from other components of system not to be lost
during JVM shutdown sequence.
And only in very exotic situations such default behavior
should be changed by user manually into something else.
Thank you for the good discussion!
--
Best regards,
Gena
_______________________________________________
Logback-user mailing list
Logback-user@qos.ch
http://mailman.qos.ch/mailman/listinfo/logback-user