mirror of
https://github.com/netbirdio/netbird.git
synced 2026-05-31 21:19:55 +00:00
Add all uncompressed logs and fix service status
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user