Uploaded image for project: 'Couchbase Gateway'
  1. Couchbase Gateway
  2. CBG-1760

Error upfront when the configured logFilePath is not writable

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 3.0
    • None
    • SyncGateway
    • Security Level: Public
    • None
    • CBG Sprint 85
    • 2

    Description

      The validateLogFilePath() function does not check if the configured logFilePath directory is writable, as it correctly assumes Lumberjack (the underlying logger) errors for a non-writable log file, but this is only done lazily on the first call to lumberjack.Logger.Write(), which is then subsequently ignored by log.Logger.Printf ... not at the time of initialization.

      Include an upfront permission check that can cause SG to fail to start if the configured log file path is not writable. This isn't perfect if somebody changes the permissions between the initial check and the subsequent logging, but we could also change logf() to call l.Output instead of l.Printf in order to get the write-time error.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              isaac.lambat Isaac Lambat
              ben.brooks Ben Brooks
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty