Closed jesperpedersen closed 11 years ago
Kohsuke Kawaguchi » file-leak-detector #4 SUCCESS This pull request looks good (what's this?)
I think the right thing to do here is for the caller of Listener.TRACE
and Listener.ERROR
to dilligently flush the stream after dumping the message there, to make sure the message gets delivered. Some of the code already does that, and we just need to be bit more thorough here.
The shutdown hook to close those streams doesn't make much sense to me, as when the JVM exits those streams are closed, and as you point out, there's no guarantee about the order this shutdown hook runs among other shutdown hooks.
I'm adjusting the code accordingly.
This allows the application to control when the listeners are flush/closed.
Needed because the installed shutdown hook maybe run first before files are closed during shutdown.