mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-06-22 14:32:35 +00:00
Improving log dump feature logs (#207)
This commit is contained in:
parent
e2db5087b8
commit
1d1b62ec4f
@ -42,19 +42,19 @@ func DumpLogs(provider *kubernetes.Provider, ctx context.Context, filePath strin
|
|||||||
if err := AddStrToZip(zipWriter, logs, fmt.Sprintf("%s.%s.log", pod.Namespace, pod.Name)); err != nil {
|
if err := AddStrToZip(zipWriter, logs, fmt.Sprintf("%s.%s.log", pod.Namespace, pod.Name)); err != nil {
|
||||||
logger.Log.Errorf("Failed write logs, %v", err)
|
logger.Log.Errorf("Failed write logs, %v", err)
|
||||||
} else {
|
} else {
|
||||||
logger.Log.Infof("Successfully added log length %d from pod: %s.%s", len(logs), pod.Namespace, pod.Name)
|
logger.Log.Debugf("Successfully added log length %d from pod: %s.%s", len(logs), pod.Namespace, pod.Name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if err := AddFileToZip(zipWriter, config.GetConfigFilePath()); err != nil {
|
if err := AddFileToZip(zipWriter, config.GetConfigFilePath()); err != nil {
|
||||||
logger.Log.Debugf("Failed write file, %v", err)
|
logger.Log.Debugf("Failed write file, %v", err)
|
||||||
} else {
|
} else {
|
||||||
logger.Log.Infof("Successfully added file %s", config.GetConfigFilePath())
|
logger.Log.Debugf("Successfully added file %s", config.GetConfigFilePath())
|
||||||
}
|
}
|
||||||
if err := AddFileToZip(zipWriter, logger.GetLogFilePath()); err != nil {
|
if err := AddFileToZip(zipWriter, logger.GetLogFilePath()); err != nil {
|
||||||
logger.Log.Debugf("Failed write file, %v", err)
|
logger.Log.Debugf("Failed write file, %v", err)
|
||||||
} else {
|
} else {
|
||||||
logger.Log.Infof("Successfully added file %s", logger.GetLogFilePath())
|
logger.Log.Debugf("Successfully added file %s", logger.GetLogFilePath())
|
||||||
}
|
}
|
||||||
logger.Log.Infof("You can find the zip with all logs in %s\n", filePath)
|
logger.Log.Infof("You can find the zip file with all logs in %s\n", filePath)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user