Skip to content

Instantly share code, notes, and snippets.

@hostmaster
Created August 12, 2015 10:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hostmaster/e141b889d2a50b2fb7a8 to your computer and use it in GitHub Desktop.
Save hostmaster/e141b889d2a50b2fb7a8 to your computer and use it in GitHub Desktop.
Write a separate log file for each docker container sending syslog messages.
template(name="DockerLog" type="string" string="/var/log/docker/container-%syslogtag:8:19%.log")
# syslog faciliyty is daemon
if ( $syslogfacility == 3 and $programname == "docker") then {
action(type="omfile" DynaFile="DockerLog")
stop
}
@gajjuR
Copy link

gajjuR commented Jun 13, 2018

Hi,
I have been trying to achieve the same. creation of syslog files for each docker container but it is not working in my environment. are there any steps to follow?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment