I am using rsyslog to handle the logs that my program creates. I have used a template to customize the logs format. My doubts are:

  • If I create a template, every program that use that rsyslog.conf file, will store its logs using that template?

  • How can I create 2 templates so that different program functions store their logs in different format?


You can split the rsyslog logs based on their program names.

Create a new file, /etc/rsyslog.d/01-programone.conf with these lines,

if $programname == 'programone' then /var/log/programone.log

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.