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

ResilientFileOutputStream loses BufferedStream over recovery

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.7, 1.0.8
    • Fix Version/s: 1.0.8
    • Component/s: logback-core
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: