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

Rolling file throws NPE

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 1.1.2
    • logback-core
    • None
    • Windows 8, Java 8.0_25

    Description

      If for some reason renaming file fails (see http://logback.qos.ch/codes.html#renamingError) then Logback internally throws NPE
      See stacktrace.txt file attached.

      Reason of heaving this exception: We are trying to rename existing file with path (lets say 'c:\Temp\2\log.log') to a file with just a name (lets say 'log2.log')
      In this case if renaming fails for some reason then we are trying to compare volumes of existing file ('c:\Temp\2\log.log') and a parent of a target file ('log2.log).
      Parent is null in this case.

      Fix would be: RenameUtil.areOnDifferentVolumes should return false if parent file is null (patch file attached)

      Attachments

        Activity

          People

            logback-dev Logback dev list
            krolen Konstantin Kulagin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: