From 77d19b758a45c434e23cdf3110488b0756dd22a8 Mon Sep 17 00:00:00 2001 From: Roland Bewick Date: Thu, 1 Feb 2024 22:00:05 +0700 Subject: [PATCH] fix: make sure app workdir exists --- service.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/service.go b/service.go index 76f4d613..35b6f6d2 100644 --- a/service.go +++ b/service.go @@ -51,6 +51,9 @@ func NewService(ctx context.Context) (*Service, error) { logger.SetOutput(os.Stdout) logger.SetLevel(log.InfoLevel) + // make sure workdir exists + os.MkdirAll(appConfig.Workdir, os.ModePerm) + fileLoggerHook, err := lumberjackrus.NewHook( &lumberjackrus.LogFile{ Filename: path.Join(appConfig.Workdir, "log/nwc-general.log"),