Add all uncompressed logs and fix service status

This commit is contained in:
Theodor S. Midtlien
2026-05-21 12:09:27 +02:00
parent a02767eacb
commit 09df098f13
3 changed files with 26 additions and 21 deletions

View File

@@ -1055,19 +1055,18 @@ func (g *BundleGenerator) addRotatedLogFiles(logDir string) {
return
}
// This regex will match plain logs rotated by logrotate on linux.
// We assume that logrotate is configured with nocompress or delaycompress.
pattern = filepath.Join(logDir, "client*.log.*")
uncompressedFiles, err := filepath.Glob(pattern)
if err != nil {
log.Warnf("failed to glob rotated logs: %v", err)
return
}
files = uncompressedFiles
if len(files) == 0 {
// We assume that logrotate is configured with nocompress.
// This regex will match plain logs rotated by logrotate on linux.
pattern := filepath.Join(logDir, "client*.log.*")
uncompressedFiles, err := filepath.Glob(pattern)
if err != nil {
log.Warnf("failed to glob rotated logs: %v", err)
return
}
files = uncompressedFiles
if len(files) == 0 {
return
}
return
}
// sort files by modification time (newest first)