You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A better approach would be to use a single stream with the demux parameter set to True, which allows you to differentiate between stdout and stderr logs.
thanks so much for your reply and the hint to use demux. This parameter is available for the exec_run method but not for the logs method I'm using.
The main difference is, that I need to intercept the stream. exec_run returns stdout and stderr as bytes after the execution is fully done. I need to see the output right when it happens.
I need to stream the logs from my docker container for logging.
Currently I do this:
Now I need to differentiate between
stdout
andstderr
. Thestdout
is supposed to be logged tologger.info
, thestderr
tologger.error
.My approach is to setup two streams, one for
stdout
and one forstderr
and read them in parallel with different threads.However, messages from
stdout
andstderr
are not always logged in correct order.I also looked into ways to access the log files from the Docker JSON File logging driver I'm using directly but couldn't find a way.
Is there a way stream the messages in correct order plus the information if the message came from
stdout
orstderr
?The text was updated successfully, but these errors were encountered: