The cleaner thread is stopped when the SiftingAppender's stop() method is called-- we clear the run flag in the Cleaner object and notify it. Are you looking for something different? I also thought that that might be a good time to call removeStaleComponents() but I believe, at least in the case of the Sifter, it isn't really needed? Not following the comment about individualExecutors? You are suggesting we drop the executorService option and just go with a separate thread? And correct-- as soon as a logging event makes it through, any stale appenders are closed. Which is the problem. We only use the sifter for special cases (triggered by a MDC discriminator) so once we stop sending logging events for one of those cases it could be days (literally!) before the sifter ends up handling more logging events, hence removeStaleComponents() never gets called. Which makes me think of another case.. should there be a flag to disable any off-main-thread cleanup for those sifters that are always getting traffic? |