-
I'm guessing this is a byproduct of how nixos itself handles containers by assigning them to systemd units, but ever since I switched backends* from podman to docker I've been having this annoying issue where practically every log line is printed both by the container and the service managing it: *I don't recall it being the case with podman, but I'm not 100% sure. Is there a way to disable one of the two log streams? Preferably the systemd unit one, as that doesn't seem to preserve color. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
For Docker specifically, you can also configure a log driver at the daemon/engine level (ref). This is controlled by the |
Beta Was this translation helpful? Give feedback.
I think I see what the problem is.
For Podman, the container runs in detached mode, which means container output does not go to stdout: https://github.com/NixOS/nixpkgs/blob/b47fd6fa00c6afca88b8ee46cfdb00e104f50bca/nixos/modules/virtualisation/oci-containers.nix#L335
I guess this can only be done with Podman because it is natively integrated with systemd. That is, systemd events will propagate to Podman and vice-versa.
I would recommend filing an upstream issue to ask about this, and whether it would be possible to add an option to suppress stdout in favor of the
log-driver
setting. One idea could be to disable stdout logging for Docker iflog-driver == "journald"
.For now, your only opti…