Docker Community Forums

Share and learn in the Docker community.

Logging distinguish stderr from stdout for syslog messages


(Camerongo) #1

Hi - I’m looking into using syslog as the docker logging driver via the docker engine config file preferences and am redirecting my apache error log and access log to stderr and stdout respectively. Ultimately these logs are destined for AWS cloudwatch. My question is: Is there any way for me to tag, redirect output, or otherwise distinguish stderr from stdout output? Ideally I’d like my syslog server to place the stderr output into one file vs. stdout into another file so they can be indexed differently.

Also - on a related note: is there any way to cause the docker logging driver to add the container ID as a data element in the syslog messages that are sent?


(Camerongo) #2

Note: I RTFM more closely and identified that the container ID is by default added to the syslog message tag, so that won’t be an issue. Still just trying to see if there is a good way to separate stderr and stdout.