From 6f19b69bbd1fcfdaff3a8706424bfbc0e3f83e82 Mon Sep 17 00:00:00 2001 From: Kyle Isom Date: Wed, 11 Nov 2020 10:06:13 -0800 Subject: [PATCH] logging: add CREATE flag to file-based loggers. --- logging/file.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/logging/file.go b/logging/file.go index fd271ed..7a5b608 100644 --- a/logging/file.go +++ b/logging/file.go @@ -59,7 +59,7 @@ func NewSplitFile(outpath, errpath string, overwrite bool) (*File, error) { if overwrite { fl.fo, err = os.Create(outpath) } else { - fl.fo, err = os.OpenFile(outpath, os.O_WRONLY|os.O_APPEND, 0644) + fl.fo, err = os.OpenFile(outpath, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0644) } if err != nil { @@ -69,7 +69,7 @@ func NewSplitFile(outpath, errpath string, overwrite bool) (*File, error) { if overwrite { fl.fe, err = os.Create(errpath) } else { - fl.fe, err = os.OpenFile(errpath, os.O_WRONLY|os.O_APPEND, 0644) + fl.fe, err = os.OpenFile(errpath, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0644) } if err != nil {