[Pkg-samba-maint] why not log to syslog by default?

Steve Langasek vorlon at debian.org
Wed Jul 18 22:35:37 UTC 2007


On Sun, Jul 15, 2007 at 03:28:30PM -0400, Tom Metro wrote:
> After looking into a problem with logwatch not handling debug messages 
> from samba, I started this thread on the logwatch-devel list:

> http://www.nabble.com/samba-Unmatched-Entries-tf4063770.html

> And in short, I'm wondered why samba was configured by default in the 
> Debian package to log to its debug logs instead of to syslog.

Because this is the historical behavior and the consequences of changing it
for Debian have not been fully examined.  For my part, any time I raise the
log level in Samba it's because I'm debugging something, and having the
separate log files under /var/log/samba comes in very handy then.

> This comment also implies that the "log level" directive impacts what is 
> logged to syslog, yet the man page gives the impression that "log level" 
> controls the logging to the "debug logs", while the "syslog" directive 
> independently controls what is logged to syslog:

AFAIK, the 'log level' controls how verbose samba is about messages it
generates, whether that's to syslog or to samba log files.  There is a
performance penalty to having samba generate lots of log entries, whether
it's sending them to syslog or to the private log file, so except when the
log level is set high I believe these are suppressed.

> But I can also see how these two might be chained together, with "log 
> level" controlling the overall logging level, and "syslog" controlling 
> the threshold of what gets sent to syslog. But if this is the case, the 
> documentation to "syslog" should reference its dependency on "log level".

Probably, yes; I'm not presuming to submit a change for this in the
documentation without someone empirically confirming that this is indeed the
behavior.

> Quoting from /usr/share/samba/smb.conf:
> > #### Debugging/Accounting ####
> > 
> > # This tells Samba to use a separate log file for each machine
> > # that connects
> >    log file = /var/log/samba/log.%m

> If you change this, it also impacts the location and naming of the 
> log.smbd and log.nmbd files, which I wouldn't expect based on the above 
> comment.

Wording improvements are definitely accepted.  (I think this comment may be
inherited from upstream?)

> > # Put a capping on the size of the log files (in Kb).
> >    max log size = 1000

> Does this end up "competing" with the logrotate.d/samba settings?

Yes, as a matter of fact it does; it would be nice to have some resolution
of this, but probably one of the first things that would need doing is to
have logrotate.d/samba support rotation of all the files under
/var/log/samba/ instead of just the main ones.

> In any case, I think the default configuration for samba should match 
> that of other daemons, which would be to log to syslog only, and at the 
> LOG_WARNING level.

> log level = 1
> syslog only = yes
> syslog = 1

> The sample configuration should include commented out lines with 
> comments on how to enable the debug logs, and boost the log level, so a 
> user debugging a problem can easily do so.

Hmm, that's an interesting position.  Of course, 'smbcontrol' makes it
possible to dynamically adjust the debug level of a running process, but you
can't do the same for 'syslog only', so I'm not sure I buy that this would
be a good default.

What do others on the team think?

-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
vorlon at debian.org                                   http://www.debian.org/



More information about the Pkg-samba-maint mailing list