On Fri, 24 Nov 2006, Alexander Farber wrote:

> Hi,
> 
> I've read "man syslog.conf" several times, especially this passage:
> 
>     !!prog causes the subsequent block to abort evaluation when a message
>     matches, ensuring that only a single set of actions is taken.  !* can be
>     used to ensure that any ensuing blocks are further evaluated (i.e. can-
>     celling the effect of a !prog or !!prog).
> 
> but don't understand it and how to adapt it for my purpose:
> 
> I have a program called "pref" which does following:
> 
>        openlog(__progname, LOG_CONS | LOG_PID, LOG_DAEMON);
> ...
>        syslog(LOG_INFO, "%s", msg);
> ...
>        syslog(LOG_WARNING, "%s", msg);
> ...
>        syslog(LOG_ERR, "%s", msg);
> 
> I'd like all of those messages to go into separate file /var/log/pref
> but not into the /var/log/messages. So first I've appended
> 
>        !pref
>        *.*                                                    /var/log/pref
> 
> to the /etc/syslog.conf, touched the /var/log/pref, adapted
> newsyslog.conf and pkill -HUPped syslogd. This worked,
> but the messages also were written into /var/log/messages.
> 
> Then I've added a second "!" and moved those 2 lines to
> the top of /etc/syslog.conf:
> 
>        !!pref
>        *.*                                                    /var/log/pref
> 
> Now no messages at all are written into /var/log/messages :-/
> 

Add the end marker !* after the *.* line

        -Otto

Reply via email to