Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-765

ResilientFileOutputStream loses BufferedStream over recovery

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 1.0.8
    • 1.0.7, 1.0.8
    • logback-core
    • None

    Description

      When ResilientFileOutputStream's base class (ResilientOutputStream ) attempts recovery it calls method openNewOutputStream() which returns an output stream instance.
      The overriden openNewOutputStream() method in ResilientFileOutputStream only creates a FileOutputStream .

      There are two problems with this:
      1. ResilientFileOutputStream's fos is not re-created and so getChannel() is referencing a closed fos value.
      2. ResilientFileOutputStream output stream is no longer buffered.

      Perhaps the body of openNewOutputStream probably should read as:

      fos = new FileOutputStream(file, true);
      return new BufferedOutputStream(fos);

      Attachments

        Activity

          People

            ceki Ceki Gülcü
            dpm dpm
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: