update log creation file

This commit is contained in:
Aleksandr Trushkin
2024-02-26 17:55:44 +03:00
parent 5bcccd8aa7
commit d7ee89e3b3
2 changed files with 2 additions and 1 deletions

1
.gitignore vendored
View File

@ -4,3 +4,4 @@ database
bin
*.xml
Makefile
config.toml

View File

@ -75,7 +75,7 @@ func SetupDI(ctx context.Context, cfgpath string, verbose bool, logAsJSON bool)
case "stderr":
output = os.Stderr
default:
outfile, err = os.Create(cfg.Log.Output)
outfile, err = os.OpenFile(cfg.Log.Output, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)
if err != nil {
return nil, fmt.Errorf("creating file for logging: %w", err)
}