firecracker-microvm / firecracker-containerd

firecracker-containerd enables containerd to manage containers as Firecracker microVMs
Apache License 2.0
2.23k stars 182 forks source link

firecracker-control plugin does not account for containerd logging setting #400

Open ustiugov opened 4 years ago

ustiugov commented 4 years ago

I would like to suppress all logging below "warning" or "fatal" but firecracker-containerd does not account for the options provided in config.toml or in CLI.

Example:

 sudo firecracker-containerd --config /etc/firecracker-containerd/config.toml --log-level fatal

I still see info logs on the screen (only from the firecracker-related components/plugins):

INFO[2020-03-05T23:02:59.070640415+01:00] starting signal loop                          namespace=firecracker-containerd path=/var/lib/firecracker-containerd/shim-base/firecracker-containerd/10001 pid=834567
INFO[2020-03-05T23:02:59.071563821+01:00] creating new VM                               runtime=aws.firecracker vmID=10001

Also, is there a way to point containerd logs to a file instead of the screen?

mxpv commented 4 years ago

Hey. Thanks for opening this. creating new VM comes from our runtime. As far as I see currently containerd doesn't pass log level to shims (see 1, 2 and 3). So it makes sense to open an issue there and start discussion in containerd first.

As for your second question, containerd outputs logs to stdout/err, and from there you can redirect logs wherever you need. For instance, if you rely on systemd, you can redirect stdout to a file like this: https://www.freedesktop.org/software/systemd/man/systemd.exec.html#StandardOutput=