[ 
https://jira.qos.ch/browse/SLF4J-192?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=19399#comment-19399
 ] 

Joachim Durchholz commented on SLF4J-192:
-----------------------------------------

The point is not that shutdown() is a problem, the point is that shutdown 
doesn't add value.

I have yet to see a convincing counterargument to the latter point. I have seen 
lots of principles-based arguments, but principles need to be tied to concrete 
advantages/disadvantages to check that the principle really applies. IOW 
principles alone are a good first approximation but not enough. (At least 
that's my perspective. YMMV.)

The application server situation might be such a use case.
I don't see how shutdown() may help with that. That's probably due to a lack of 
familiarity with logging in application servers, not a counterargument; I would 
like to see how things get easier if you have a shutdown().
However, I am drawing a counterargument from the AS case: What should the 
logger implementation do if it gets a shutdown() call? If it's closing shared 
resources, this is actually NOT what you want: You don't want that a servlet 
shuts down container resources! If it's closing a per-servlet resource (e.g. 
because the servlet isn't using the container's logger but its own): then the 
servlet already knows that it has a specific resource, and we're back at the 
normal application case.

I would really like to hear where my picture is incomplete.

> Need ability to shutdown loggers and flush appenders
> ----------------------------------------------------
>
>                 Key: SLF4J-192
>                 URL: https://jira.qos.ch/browse/SLF4J-192
>             Project: SLF4J
>          Issue Type: Improvement
>          Components: Core API
>    Affects Versions: 1.6.x
>         Environment: Operating System: All
> Platform: All
>            Reporter: Michael Schall
>            Assignee: SLF4J developers list
>
> There needs to be a way to shutdown logging and flush async appenders so when 
> a process is closing, all log events are written before the process is closed.
> Should ILoggerFactory have a shutdown or stop method?  It could shutdown 
> whatever logging back end I'm using?
> For log4j it would call - 
> org.apache.log4j.LogManager.getLoggerRepository().shutdown();
> For logback it would call - loggerContext.stop()
> Other back ends - ???
> This is required to allow me to not reference logging back ends explicitly in 
> my code to shutdown successfully without losing events.
> Discussion about this is happening on the user list at -
> http://www.qos.ch/pipermail/logback-user/2010-September/001816.html



--
This message was sent by Atlassian JIRA
(v7.3.1#73012)
_______________________________________________
slf4j-dev mailing list
[email protected]
http://mailman.qos.ch/mailman/listinfo/slf4j-dev

Reply via email to