Fix log file open and bundle uncompressed files

This commit is contained in:
Theodor S. Midtlien
2026-05-20 15:17:00 +02:00
parent b9a7375f64
commit bcda5eddbb
2 changed files with 2 additions and 2 deletions

View File

@@ -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)

View File

@@ -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)
}