Force FileAppender embedded in SiftingAppender to stop

Hi, In an application I am developing I am using a SiftingAppender embedding a FileAppender, defined within a logback configuration file. Each FileAppender manages the logging events generated by a particular process. Each process knows nothing (and should know nothing) about the appenders managing its logging event. I read in the documentation that an appender created by SiftingAppender is automatically closed and discarded if unused for 30 minutes. I would like to stop the FileAppender associated to a process as soon as the process ends its executions, this in order to close the associated file and to avoid having a lot of opened streams. The solution I came up with consists in defining a custom FileAppender (to be embedded in the SiftingAppender) that stops itself upon receiving a logging event with a particular marker, e.g., STOP. What do you think of this solutions? Are there any other (maybe better) possible solutions I should consider? Cheers, Dario
participants (1)
-
Dario Campagna