diff --git a/ocis-pkg/log/log.go b/ocis-pkg/log/log.go index 72e880b1cc..8b95d0fe49 100644 --- a/ocis-pkg/log/log.go +++ b/ocis-pkg/log/log.go @@ -64,7 +64,8 @@ func NewLogger(opts ...Option) Logger { } else if options.File != "" { f, err := os.OpenFile(options.File, os.O_CREATE|os.O_APPEND|os.O_RDWR, 0644) if err != nil { - panic(err) + print(fmt.Sprintf("file could not be opened for writing: %s. error: %v", options.File, err)) + os.Exit(1) } logger = logger.Output(f) } else {