Details
-
Improvement
-
Resolution: Fixed
-
Major
-
None
-
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
- relates to
-
CBG-1722 logs not generating at custom log file path
- Closed