From 2fd2c3da4e0f2b89dfa5d4e48d9bac2d0c184c3f Mon Sep 17 00:00:00 2001 From: Cottand Date: Mon, 30 Sep 2024 21:24:10 +0100 Subject: [PATCH] fix path for logs not cleaned --- logger.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/logger.go b/logger.go index 39d08dc..f5527cb 100644 --- a/logger.go +++ b/logger.go @@ -4,6 +4,7 @@ import ( "fmt" "io" "os" + "path/filepath" "regexp" "strconv" "strings" @@ -95,6 +96,7 @@ func parseLogConfig(logConfigString string) (*logConfig, error) { } func createLogFile(fileName string) (*os.File, error) { + fileName = filepath.Clean(fileName) if _, err := os.Stat(fileName); os.IsNotExist(err) { if _, err := os.Create(fileName); err != nil { return nil, fmt.Errorf("error creating log file '%s': %s", fileName, err)