Here's an example of how, on openSUSE 13.1, I direct log messages from the
dhcpcd process
only to a separate log file:
Code:
# dhcpcd messages in a separate file, and not in /var/log/messages.
if ($programname == 'dhcpcd') \
then -/var/log/dhcp
& stop
#
# the rest in one file
#
*.*;mail.none;news.none -/var/log/messages
The:
says that the chosen log messages should not be matched against any further patterns in the configuration file, that processing of the selected messages should
stop at that point. If the
stop wasn't there,
*.* would match, and the messages would also be placed in
/var/log/messages. In fact, since I've included only part of the configuration file, there are also other patterns later in the file that would match.
HTH.