mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-12 16:39:09 +02:00
Fix log file open and bundle uncompressed files
This commit is contained in:
@@ -1060,10 +1060,10 @@ func (g *BundleGenerator) addRotatedLogFiles(logDir string) {
|
|||||||
log.Warnf("failed to glob rotated logs: %v", err)
|
log.Warnf("failed to glob rotated logs: %v", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
files = uncompressedFiles
|
||||||
if len(files) == 0 {
|
if len(files) == 0 {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
files = uncompressedFiles
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// sort files by modification time (newest first)
|
// sort files by modification time (newest first)
|
||||||
|
|||||||
+1
-1
@@ -117,7 +117,7 @@ func isRotationDisabled(logger *log.Logger) bool {
|
|||||||
|
|
||||||
func setupLogFile(logPath string, disableRotation bool) (io.Writer, error) {
|
func setupLogFile(logPath string, disableRotation bool) (io.Writer, error) {
|
||||||
if disableRotation {
|
if disableRotation {
|
||||||
file, err := openOrCreateFile(logPath)
|
file, err := os.OpenFile(logPath, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0o640)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed opening log file: %s", err)
|
return nil, fmt.Errorf("failed opening log file: %s", err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user