Docker Community Forums

Share and learn in the Docker community.

Apply levels to log messages forwarded to journald

docker

(Mvgrimes) #1

Is there a way to set the level for log messages passed to the journald logging driver?

Our applications prints log message to STDOUT with the level prefixed (ie, <3> the foo failed). If the app is spawned from systemd units, then that log message would end up with PRIORITY=3 (error). If it is not spawned by a systemd unit, then we can use systemd-cat to inject the message into the journal with the appropriate error level.

As we explore migrating to docker, we had hoped that the log level would be picked up by the journald logging driver, but that doesn’t seem to be the case. We could live with just two log levels, if STDOUT and STDERR were treated different, but they both seem to get PRIORITY=6.