containerd / rust-extensions

Rust crates to extend containerd
https://containerd.io
Apache License 2.0
184 stars 73 forks source link

Use log format similar to containerd #210

Closed jsturtevant closed 1 year ago

jsturtevant commented 1 year ago

Currently a shim default logs don't have time in it which can make it hard to debug timing issues:

[INFO] starting instance: f117ec9ffa52b4a5cc2550cc4ff301b645b83289f927ae4ddaeba36fd5d6aab0
[INFO] cgroup manager V2 will be used

this PR sets up the log format so that it is in same format as containerd (not including msg as that can be left to the implementor)

#example containerd log
time="2023-10-04T00:06:36.183411295Z" level=info msg="StartContainer for \"bbfbebc5259e9bc6ef12b8749e9c1760aac461db5ae506fe8c18b645c136cb4a\""

# example shim after change
time="2023-10-04T00:06:36.185484399Z" level=info instantiating instance
time="2023-10-04T00:06:36.185818899Z" level=info getting start function