[client] Add systemd netbird logs to debug bundle (#3917)

This commit is contained in:
Viktor Liu
2025-06-05 13:54:15 +02:00
committed by GitHub
parent 55957a1960
commit 84354951d3
4 changed files with 110 additions and 4 deletions

View File

@@ -274,10 +274,15 @@ func (g *BundleGenerator) createArchive() error {
log.Errorf("Failed to add wg show output: %v", err)
}
if g.logFile != "console" {
if g.logFile != "console" && g.logFile != "" {
if err := g.addLogfile(); err != nil {
return fmt.Errorf("add log file: %w", err)
log.Errorf("Failed to add log file to debug bundle: %v", err)
if err := g.trySystemdLogFallback(); err != nil {
log.Errorf("Failed to add systemd logs as fallback: %v", err)
}
}
} else if err := g.trySystemdLogFallback(); err != nil {
log.Errorf("Failed to add systemd logs: %v", err)
}
return nil