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

Add a simple 'null' test to capture when 'read' access is not granted to logs folder

    XMLWordPrintable

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 1.1.2
    • logback-core
    • None

    Description

      I had a problem tracking down why every third rolled log file was missing (see https://www.mail-archive.com/logback-user@qos.ch/msg04293.html). Turns out the underlying problem was we had write and execute permissions on our log folder, but not read. So, logs were being created, and 2/3 of our rolled log files were being created, with no info in the catalina.out (we're running under tomcat), or in the log files themselves.

      The symptom was being caused by code in SizeAndTimeBasedArchiveRemover, which calls FileFilterUtil.filesInFoderMatchingStemRegex(), which returns null when there are no read permissions.

      Suggestion: Add a check, perhaps in FileFilterUtil, which checks to see if the return is null (indicating an I/O Error according to the java.io.File docs), and if so, indicate that somehow - even if only when logback is running in debug mode. (Currently, when running debug mode, there's an NPE thrown from SizeAndTimeBasedArchiveRemover, since the code assumes a non-null response from filesInFolderMatchingStemRegex).

      Thanks!

      Attachments

        Activity

          People

            logback-dev Logback dev list
            rpsandiford Robert Sandiford
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: