containers/toolbox

Debug logs are being logged as errors

A6GibKm opened this issue · 4 comments

Doing journalctl -e -p err will return

sep 29 17:59:34 thinkpad fedora-toolbox-39[7726]: level=debug msg="Binding /var/lib/systemd/coredump to /run/host/var/lib/systemd/coredump"
sep 29 17:59:34 thinkpad fedora-toolbox-39[7726]: level=debug msg="Creating directory /var/log/journal"
sep 29 17:59:34 thinkpad fedora-toolbox-39[7726]: level=debug msg="Binding /var/log/journal to /run/host/var/log/journal"

and others.

$ toolbox --version
toolbox version 0.0.99.4

I haven't dug too much into this.

So far, my suspicion is that podman start logs everything being sent to the standard error stream as an error. Toolbx does use the standard error stream for all its verbose output. It has done so since the very early days of the POSIX shell implementation, and is also the default for logrus that the Go implementation uses today.

Whatever we do here, we should probably take care not to break podman logs, and the ability to see the logs in the terminal with podman start --attach ... or toolbox --verbose ... Those are really useful for when hacking and debugging Toolbx.

So far, my suspicion is that podman start logs everything being sent to the standard error stream as an error. Toolbx does use the standard error stream for all its verbose output.

Ah! That might be it! Then the solution to this could be fairly straightforward by setting the logging output to stdout when Toolbx is being used as the entry-point.

This is the relevant Podman bug:
containers/podman#20728

I think we should switch logrus to use the standard output stream for all verbose output and only use the standard error stream for actual errors.