diff --git a/commit/log.go b/commit/log.go index 6311bbe31a14adaf1351c9f8138e7b0a79b373b4..6fec71e6ff5fa6b5b34f606c416890b2d65a37f7 100644 --- a/commit/log.go +++ b/commit/log.go @@ -282,6 +282,12 @@ func (l *Logger) Init() { glog.Debug("Logger init started.") { + // Checking if the directory exists. + if _, err := os.Stat(l.dir); err != nil { + if os.IsNotExist(err) { + glog.WithError(err).Fatal("Unable to find dir.") + } + } // First check if we have a current file. path := filepath.Join(l.dir, fmt.Sprintf("%s-current.log", l.filePrefix)) fi, err := os.Stat(path)