From 85f4e7caf687b8fa40c4c25ef6d00b4ff1d0cd7e Mon Sep 17 00:00:00 2001 From: Bin Liu Date: Tue, 26 Jul 2022 16:08:59 +0800 Subject: [PATCH] runtime: explicitly mark the source of the log is from qemu.log In qemu.StopVM(), if debug is enabled, the shim will dump logs from qemu.log, but users don't know which logs are from qemu.log and shim itself. Adding some additional messages will help users to distinguish these logs. Fixes: #4745 Signed-off-by: Bin Liu --- src/runtime/virtcontainers/qemu.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/virtcontainers/qemu.go b/src/runtime/virtcontainers/qemu.go index 656548e88c..1acc48cac7 100644 --- a/src/runtime/virtcontainers/qemu.go +++ b/src/runtime/virtcontainers/qemu.go @@ -990,7 +990,7 @@ func (q *qemu) StopVM(ctx context.Context, waitOnly bool) error { if err == nil { scanner := bufio.NewScanner(f) for scanner.Scan() { - q.Logger().Debug(scanner.Text()) + q.Logger().WithField("file", q.qemuConfig.LogFile).Debug(scanner.Text()) } if err := scanner.Err(); err != nil { q.Logger().WithError(err).Debug("read qemu log failed")