############################################################################# # Default syslog-ng.conf file which collects all local logs into a # single file called /var/log/messages tailored to container usage. # # The changes from the stock, default syslog-ng.conf file is that we've # dropped the system() source that is not needed and that we enabled network # connections using default-network-drivers(). Customize as needed and # override using the -v option to docker, such as: # # docker run ... -v "$PWD/syslog-ng.conf":/etc/syslog-ng/syslog-ng.conf # @version: 3.29 @include "scl.conf" source s_local { internal(); }; source s_network { default-network-drivers(); }; # Force every message into the standard RFC5424 format that Promtail expects. template t_promtail_rfc5424 { template("<${PRI}>1 ${ISODATE} ${HOST} ${PROGRAM} ${PID} ${MSGID} - ${MSG}\\n"); }; destination d_loki { syslog("promtail" transport("tcp") port("1514") # APPLY THE TEMPLATE TO THE DESTINATION template(t_promtail_rfc5424) ); }; log { source(s_local); source(s_network); destination(d_loki); };