[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Logging procedure/mechanism questions



Okay... I'm making some good progress with my portslave package.  The
(hopefully) last major hurdle I have to pass now has to do with how and
where to keep and rotate log files.

Let me first say that my understanding of syslog's funcionalilty is somewhat
limited.

Portslave, by default, logs to "syslog facility 6" (whatever that means). 
The stock installation instructions say:

  First you'll have to choose where to let the portslaves log their
  messages. The portslaves can use both a local or a remote syslog
  daemon. On that machine, do the following:

  o add "local6      /var/log/local6.log" to /etc/syslog.conf
  o change any lines that look like "*.debug" or "*.info" to
    "*.debug;local6.none" to prevent sensitive info being logged to
    maybe publically readable files.
  o Create /var/log/local6.log and chmod 600 it so that it's safe.

Now it obvoiusly seems tomake more sense to store the logs in
/var/log/portslave.log (or something comparable) rather than
/var/log/local6.log.

It would be easy to change the syslog.conf line to this effect, but my
question is... is this the "correct" way to do it?  Is logging to the
"local6" facility (whatever that means) a good idea, or should I hack the
source to log to its own file somehow (I know nothing about programming w/
syslog... It'll be an adventure. :-)

If it is sufficient to just change this one line in /etc/syslog.conf to log
to /var/log/portslave.log, what is the proper procedure to follow the second
step ('change any lines that look like "*.debug" or "*.info" to...')? 
Doing, then undoing that could make for some pretty hefty postinst and
postrm scripts...

And then my last question... What's the proper way to handle log rotation? 
According to the Debian Policy manual (section 4.8), I should use logrotate. 
This package does not exist on my system, tho... I find it odd that
absolutely no other package I'm using (granted, I don't have all the Debian
packages installed) are following the Debian policy.  If this is the proper
way, I suppose I need to make my package depend on logrotate?

The other option I see is to incorperate my package into the
/etc/cron.weekly/sysklogd script (which I've no experience with
yet--something else I'd need to learn).  This is the way most (all?)
packages on my system currently rotate their logs.

So, in a nutshell, my questions:

1. Is logging to "facility 6" bad?  If so, what are the acceptable
alternatives?  If not, what's the best way to accomplish the second step of
the stock installation instructions?

2. Should I use logrotate or /etc/cron.weekly/sysklogd to handle log
rotation?

Thanks for any help!


--
"Everything that can be invented has been invented." -- Charles H. Duell,
Commissioner, U.S. Office of Patents, 1899.
--
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  Jonathan Hall  *  jonhall@futureks.net  *  PGP public key available
 Systems Admin, Future Internet Services; Goessel, KS * (316) 367-2487
         http://www.futureks.net  *  PGP Key ID: FE 00 FD 51
                  -=  Running Debian GNU/Linux  =-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


Reply to: