[logback-user] ResilientFileOutputStream close method

Dario Campagna campagna at esteco.com
Thu Jul 26 09:41:50 CEST 2012


Hi all,

   I noticed a possible problem in the class ResilientFileOutputStream,
used in FileAppender to create the output stream.

The class ResilientFileOutputStream has two output stream, a
FileOutputStream and an OutputStream (instantiated with a
BufferedOutputStream). The latter is inherited from the class
ResilientFileOutputStreamBase that ResilientFileOutputStream extends.
Since ResilientFileOutputStream has no close method, when a FileAppender is
stopped the close method of ResilientFileOutputStreamBase gets called, this
method only close the OutputStream.

Hence, when a FileAppender is stopped, the FileOutputStream of
ResilientFileOutputStream is not closed. As a consequence, instances of
FileAppender, ResilientFileOutputStream and FileOutPutStream are kept in
memory even if they are no more used.


Dario
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20120726/88b7d73b/attachment.html>


More information about the Logback-user mailing list