a.s*_*ith 3 logs syslog openldap
我在 centos7 上运行了 openldap v 2.4 并且可以正常工作,但是我无法让它记录任何内容。我尝试将以下行添加到 rsyslog.conf 文件中,但我仍然没有得到任何日志文件。
LOCAL4.* /var/log/openldap/slapd.log
Run Code Online (Sandbox Code Playgroud)
当我添加这一行时,我运行了以下命令来重新加载 rsyslog conf,并且还停止并启动了 openldap。
pkill -HUP rsyslog
Run Code Online (Sandbox Code Playgroud)
我找不到有关如何启用日志记录的更多说明。
要启用 OpenLDAP 调试,您需要将以下内容添加到您的 slapd.conf
loglevel <level> (eg: stats)
Run Code Online (Sandbox Code Playgroud)
如果您不使用slapd.conf
,则可以将该选项传递给 slapd 服务。在 debian/ubuntu 中,你会找到一些/etc/default/slapd
文件,你可以更新它的SLAPD_OPTIONS
:
$ grep SLAPD_OPTIONS /etc/default/slapd
SLAPD_OPTIONS="-s 256"
Run Code Online (Sandbox Code Playgroud)
然后我们可以重新启动 slapd:
systemctl restart slapd
Run Code Online (Sandbox Code Playgroud)
有效的 slapd 日志级别包括:
| -1 | Enable all debugging |
| 0 | Enable no debugging |
| 1 | Trace function calls |
| 2 | Debug packet handling |
| 4 | Heavy trace debugging |
| 8 | Connection management |
| 16 | Log packets sent and recieved |
| 32 | Search filter processing |
| 64 | Configuration file processing |
| 128 | Access control list processing |
| 256 | Stats log connections, operations and results |
| 512 | Stats log entries sent |
| 1024 | Log communication with shell backends |
| 2048 | Log entry parsing debugging |
Run Code Online (Sandbox Code Playgroud)
有关更多详细信息,请参阅http://www.openldap.org/doc/admin24/slapdconfig.html
此外,正如杰夫指出的那样,您的系统日志配置一开始看起来是错误的。
LOCAL4.* /var/log/openldap/
Run Code Online (Sandbox Code Playgroud)
应该是:
LOCAL4.* /var/log/openldap/some-file.log
Run Code Online (Sandbox Code Playgroud)
或者:
LOCAL4.* /var/log/openldap.log
Run Code Online (Sandbox Code Playgroud)