Fix log directory not being created

This commit is contained in:
Matthew Penner
2020-08-24 11:29:40 -06:00
parent 7aaa51a14f
commit b3a2a76f25
2 changed files with 4 additions and 5 deletions

View File

@@ -337,6 +337,10 @@ func Execute() error {
// Configures the global logger for Zap so that we can call it from any location
// in the code without having to pass around a logger instance.
func configureLogging(logDir string, debug bool) error {
if err := os.MkdirAll(config.Get().System.LogDirectory, 0700); err != nil {
return errors.WithStack(err)
}
cfg := zap.NewProductionConfig()
if debug {
cfg = zap.NewDevelopmentConfig()