2010/1/13 Mark Thomas <ma...@apache.org>: > On 13/01/2010 16:24, Konstantin Kolinko wrote: >> There is Mark's patch for that (r898468), but I have doubts >> regarding Runtime.getRuntime().addShutdownHook(new Cleaner()); >> used there. > > Why? It is pretty much identical to the code in the standard LogManager. >
One thing is that all shutdown hooks start at the same time and run in parallel, with no precedence relative each other. It might help to know, what exactly you are observing. (Maybe file a BZ issue?) One test, using Windows XP, JRE 6u16: 1. catalina.bat run 2. Press Ctrl+C in the console. Current trunk and current tc6.0.x: terminates immediately. No "shutting down" log messages neither on the screen, nor in logs. Thus messages are lost, and the patch does not fix it. There is some delay, so I think the shutdown process is actually being performed. Setting 1catalina.org.apache.juli.FileHandler.bufferSize=-1 in logging.properties does not fix it either. Current tc5.5.x (though don't remember when I compiled it): Shows a lot of "shutting down" log messages. With 6.0.20 I see log messages in the console and in catalina.2010-01-14.log: 14.01.2010 4:38:30 org.apache.coyote.http11.Http11Protocol pause INFO: Pausing Coyote HTTP/1.1 on http-8080 14.01.2010 4:38:31 org.apache.catalina.core.StandardService stop INFO: Stopping service Catalina 14.01.2010 4:38:32 org.apache.coyote.http11.Http11Protocol destroy INFO: Stopping Coyote HTTP/1.1 on http-8080 I thought that I'll also see some occurrences of reportError("FileHandler is closed or not yet initialized messages from o.a.juli.FileHandler#publish(), (I remember seeing them several times last month when Ctrl+C'ing a console on WinXP) but I have not observed them now, so that is not confirmed. > * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=48421 > Prevent file descriptor leak. Allow a web application's logs to be deleted > once the application has been stopped. >(...) > http://svn.apache.org/viewvc?rev=898468&view=rev How this (web application's logs) part of the issue is fixed? Is it that thanks to the change to LogFactory.java? Or ClassLoaderLogManager.java change is also needed? >> We could disable log buffering in 6.0.23, to be it the same as in >> 6.0.20 (were logs were not buffered): >> a) by setting bufferSize=0 or -1 explicitly in the default >> logging.properties file >> b) by changing the default value in o.a.juli.FileHandler to disable >> buffering. >> >> I am ok with any of a) and b). Any thoughts? > > Buffered logs are useful. Lets just fix not flushing the buffers on shut > down. > > Mark > Best regards, Konstantin Kolinko --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org