Client specific logging

From SambaWiki
Revision as of 10:37, 16 November 2010 by BBaumbach (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

When diagnosing a problem, Samba developers are likely to request a level 10 log file.

There are different reasons for creating client specific log files:

  • If the error appears only on specific clients and you won't change the config for all clients.
  • If you're running Samba with many clients level 10 logs can fill your disk space very fast and slow down your system.

Create a new config file /etc/samba/smb.conf.client-debug

max log size = 0                  # no log file size limitation
log file = /var/log/samba/log.%I  # specific log file name
log level = 10                    # set the debug level
debug pid = yes                   # add the pid to the log
debug hires timestamp = yes       # add microsecond resolution to timestamp

Add the following line to your smb.conf

include = /etc/samba/smb.conf.client-%I

To activate level 10 logging for e.g. client create a symbolic link:

ln -s /etc/samba/smb.conf.client-debug /etc/samba/smb.conf.client-

You do not have to restart all of Samba. If the client connects to your samba the smbd includes the /etc/samba/smb.conf.client- config file and writes the debug information to /var/log/samba/log. These changes will have no effect to other clients except For additional clients you can simply create additional symlinks.