Openldap log问题

问题: 如何设定openldap的log输出呢?
 
首先需要了解openldap的loglevel:
# man slapd.conf
 
       loglevel <integer> [...]
              Specify  the  level  at  which  debugging  statements and operation statistics should be syslogged
              (currently logged to the syslogd(8) LOG_LOCAL4 facility).   They  must  be  considered  subsystems
              rather  than  increasingly  verbose  log  levels.   Some  messages with higher priority are logged
              regardless of the configured loglevel as soon as some logging is configured, otherwise anything is
              logged at all.  Log levels are additive, and available levels are:
                      1      (0x1 trace) trace function calls
                      2      (0x2 packet) debug packet handling
                      4      (0x4 args) heavy trace debugging (function args)
                      8      (0x8 conns) connection management
                      16     (0x10 BER) print out packets sent and received
                      32     (0x20 filter) search filter processing
                      64     (0x40 config) configuration file processing
                      128    (0x80 ACL) access control list processing
                      256    (0x100 stats) stats log connections/operations/results
                      512    (0x200 stats2) stats log entries sent
                      1024   (0x400 shell) print communication with shell backends
                      2048   (0x800 parse) entry parsing
                      4096   (0x1000 cache) caching (unused)
                      8192   (0x2000 index) data indexing (unused)
                      16384  (0x4000 sync) LDAPSync replication
                      32768  (0x8000 none) .ly messages that get logged whatever log level is set
              The  desired  log  level can be input as a single integer that combines the (ORed) desired levels,
              both in decimal or in hexadecimal notation, as a list of integers (that are ORed  internally),  or
              as a list of the names that are shown between brackets, such that
                  loglevel 129
                  loglevel 0x81
                  loglevel 128 1
                  loglevel 0x80 0x1
                  loglevel acl trace
              are  equivalent.   The  keyword  any  can  be  used  as a shortcut to enable logging at all levels
              (equivalent to -1).  The keyword none, or the  equivalent  integer  representation,  causes  those
              messages  that  are  logged  regardless  of  the configured loglevel to be logged.  In fact, if no
              loglevel (or a 0 level) is defined, no logging occurs, so at least the none level is  required  to
              have high priority messages logged.
 
设置/etc/openldap/slapd.conf
 
添加:
#setup log
loglevel 256
 
设置/etc/syslog.conf
添加:
# save OpenLDAP log
local4.*                                                /var/log/ldap/ldap.log
 
# mkdir /var/log/ldap
# touch /var/log/ldap/ldap.log
# chown -R ldap.ldap /var/log/ldap
 
# service ldap restart
# service syslog restart
 

你可能感兴趣的:(职场,openLdap,休闲)