Log LDAP with rsyslog on CentOS 6
Send the LDAP service (slapd) messages to a dedicated file with rsyslog on CentOS 6.
This article describes how to send the logging messages of the LDAP service (slapd) to a dedicated file, using rsyslog on CentOS 6.
Configure rsyslog
Open the configuration file:
vi /etc/rsyslog.conf
Add the following rule, where the ... lines stand for the existing content of the file:
...
## LDAP
local4.* /var/log/ldap.log
...
Restart rsyslog
/etc/init.d/rsyslog restart
Expected output:
Shutting down system logger: [ OK ]
Starting system logger: [ OK ]
Create the log file and restart slapd
touch /var/log/ldap.log
service slapd restart
tail -100f /var/log/ldap.log