mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-10-08 18:13:28 +00:00
logging: Add containerID and sandboxID to all log calls
Adding cid+sid fields to the log entries generated by most of the CLI commands will make debugging across the system easier. Fixes #452. Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
||||
|
||||
vc "github.com/kata-containers/runtime/virtcontainers"
|
||||
"github.com/kata-containers/runtime/virtcontainers/pkg/oci"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
@@ -46,6 +47,11 @@ func start(containerID string) (vc.VCSandbox, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
kataLog = kataLog.WithFields(logrus.Fields{
|
||||
"container": containerID,
|
||||
"sandbox": sandboxID,
|
||||
})
|
||||
|
||||
containerID = status.ID
|
||||
|
||||
containerType, err := oci.GetContainerType(status.Annotations)
|
||||
|
Reference in New Issue
Block a user