toolbox icon indicating copy to clipboard operation
toolbox copied to clipboard

Debug logs are being logged as errors

Open A6GibKm opened this issue 2 years ago • 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

A6GibKm avatar Sep 29 '23 16:09 A6GibKm

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.

debarshiray avatar Sep 30 '23 09:09 debarshiray

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.

debarshiray avatar Sep 30 '23 09:09 debarshiray

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.

martymichal avatar Nov 01 '23 17:11 martymichal

This is the relevant Podman bug: https://github.com/containers/podman/issues/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.

debarshiray avatar May 17 '24 12:05 debarshiray