I want to save log messages from program foobar
with log level err
into file /var/log/foobar.log
in rsyslogd. How can I do that?
This is how I can filter messages by program name:
:programname,contains,"foobar" /var/log/foobar.log
This is how I can filter messages by log level:
*.err /var/log/foobar.log
But I don't understand how to filter by both these filters at the same time.