如何在 slapd.d 中设置日志级别?

如何在 slapd.d 中设置日志级别?

我已经在 Debian 11 上设置了 openLDAP 2.4,我想更改一些参数,例如日志级别和日志文件,这看起来非常简单:

# man slapd.conf
SLAPD.CONF(5)                                                       File Formats Manual                                                      SLAPD.CONF(5)

NAME
       slapd.conf - configuration file for slapd, the stand-alone LDAP daemon

SYNOPSIS
       /etc/ldap/slapd.conf

DESCRIPTION
       The  file /etc/ldap/slapd.conf contains configuration information for the slapd(8) daemon.  This configuration file is also used by the SLAPD tools
       slapacl(8), slapadd(8), slapauth(8), slapcat(8), slapdn(8), slapindex(8), and slaptest(8).
...
       logfile <filename>
              Specify a file for recording debug log messages. By default these messages only go to stderr and are not recorded anywhere else.  Specifying
              a logfile copies messages to both stderr and the logfile.

       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
...

只不过没有名为slapd.conf;的文件它已被 取代/etc/ldap/slapd.d,后者更加整洁。但是,我没有找到有关slapd.conf参数如何适应的描述/etc/ldap/slapd.dolcLogLevel其中调用了一个参数/etc/ldap/slapd.d/cn=config.ldif,很可能就是这个参数,但是来自 的其他参数又如何呢slapd.conf

无论如何,我的问题是:如何更改新方案中的日志级别和日志文件?

答案1

请参阅slapd-config(5)手册页。几乎所有设置在 LDAP 配置后端中都保留相同的名称,仅具有olc名称空间前缀。 (您确实应该通过 LDAP 或至少通过 来编辑这些内容slapmodify,而不是手动编辑。)

       olcLogFile: <filename>
              Specify a file for recording slapd debug messages. By default these  mes‐
              sages  only  go  to stderr, are not recorded anywhere else, and are unre‐
              lated to messages exposed by  the  olcLogLevel  configuration  parameter.
              Specifying a logfile copies messages to both stderr and the logfile.

       olcLogFileFormat: debug | syslog-utc | syslog-localtime
              Specify  the prefix format for messages written to the logfile. The debug

       [...]

       olcLogLevel: <integer> [...]
              Specify the level at which debugging statements and operation  statistics
              should be syslogged (currently logged to the syslogd(8) LOG_LOCAL4 facil‐

相关内容