diff --git a/client/internal/debug/debug.go b/client/internal/debug/debug.go index a5136334b..4f84c2457 100644 --- a/client/internal/debug/debug.go +++ b/client/internal/debug/debug.go @@ -1060,10 +1060,10 @@ func (g *BundleGenerator) addRotatedLogFiles(logDir string) { log.Warnf("failed to glob rotated logs: %v", err) return } + files = uncompressedFiles if len(files) == 0 { return } - files = uncompressedFiles } // sort files by modification time (newest first) diff --git a/util/log.go b/util/log.go index c17559fd8..a3c38015c 100644 --- a/util/log.go +++ b/util/log.go @@ -117,7 +117,7 @@ func isRotationDisabled(logger *log.Logger) bool { func setupLogFile(logPath string, disableRotation bool) (io.Writer, error) { if disableRotation { - file, err := openOrCreateFile(logPath) + file, err := os.OpenFile(logPath, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0o640) if err != nil { return nil, fmt.Errorf("failed opening log file: %s", err) }