zone based logging

Gregory Hicks ghicks at cadence.com
Sat Sep 25 18:10:11 UTC 2004


> Received-SPF: none (mailbox7.ucsd.edu: domain of poster at giganews.com 
does not designate permitted sender hosts)
> From: Barry Margolin <barmar at alum.mit.edu>
> Subject: Re: zone based logging
> Date: Sat, 25 Sep 2004 13:36:14 -0400
> To: comp-protocols-dns-bind at isc.org
> 
> In article <cj2vs2$o6c$1 at sf1.isc.org>,
>  "Ralf Kleinfeld" <ralf.kleinfeld at gmx.com> wrote:
> 
> > I am looking for a way to seperate the logging into
> > different logfiles for each zone.
> > Can anyone give me a hint or even a solution for that?
> 
> Use a syslog server that allows you to redirect to different log
> files based on pattern matching.  Maybe syslog-ng supports this.

Or send syslog output to a 'pipe' and use a quick and dirty script to
filter out the stuff you want to keep from the stuff you don't.

We use this with sendmail.  logging via syslog.conf is sent to
/var/log/mail-pipe ("mknod /var/log/mail-pipe p" does the trick nicely)
and then something like this that is started at the same time as
sendmail:

cat /var/log/mail-pipe | while read line1 ; do
echo $line1|grep sendmail.external >> /var/log/mail.external
echo $line1|grep sendmail.internal >> /var/log/mail.internal
echo $line1|grep -v sendmail.internal|grep -v sendmail.external >> 
/var/log/mail.common
done

We end up with three files as you see above...

Just a thought...

Regards,
Gregory Hicks

---------------------------------------------------------------------
Gregory Hicks                           | Principal Systems Engineer
Cadence Design Systems                  | Direct:   408.576.3609
555 River Oaks Pkwy M/S 6B1             | Fax:      408.894.3479
San Jose, CA 95134                      | Internet: ghicks at cadence.com

I am perfectly capable of learning from my mistakes.  I will surely
learn a great deal today.

"A democracy is a sheep and two wolves deciding on what to have for
lunch.  Freedom is a well armed sheep contesting the results of the
decision." - Benjamin Franklin

"The best we can hope for concerning the people at large is that they
be properly armed." --Alexander Hamilton



More information about the bind-users mailing list