From e33bd6874f41d7943a16fa36802f8d2db74c99b5 Mon Sep 17 00:00:00 2001 From: Landry Benguigui Date: Fri, 24 May 2024 14:24:03 +0200 Subject: [PATCH] Append to log file if it exists --- cmd/traefik/logger.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/traefik/logger.go b/cmd/traefik/logger.go index 4a3a10893..58b7abbe3 100644 --- a/cmd/traefik/logger.go +++ b/cmd/traefik/logger.go @@ -49,7 +49,7 @@ func getLogWriter(staticConfiguration *static.Configuration) io.Writer { var w io.Writer = os.Stderr if staticConfiguration.Log != nil && len(staticConfiguration.Log.FilePath) > 0 { - _, _ = os.Create(staticConfiguration.Log.FilePath) + _, _ = os.OpenFile(staticConfiguration.Log.FilePath, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0o666) w = &lumberjack.Logger{ Filename: staticConfiguration.Log.FilePath, MaxSize: staticConfiguration.Log.MaxSize,