Thursday, 23 December 2010

Set up LDAP logging

Setup LDAP logging
add to the slapd.conf
logfile /var/log/ldap.log
loglevel stats

add the following line to /etc/syslog.conf
local4.* /var/log/ldap.log

Create empty log file
touch /var/log/ldap.log
Set appropriate permission
chown ldap:ldap /var/log/ldap.log
Rotaiting log file weekly
Add empty file lgap to directory /etc/logrotate.d
touch /etc/logrotate.d/ldap
Add appropriate rules for rotation
vi /etc/logrotate.d/ldap
# Logrotate file for LDAP
# Logrotate file for LDAP
/var/log/ldap {
missingok
compress
notifempty
weekly
rotate 5
postrotate
/sbin/service ldap reload
endscript
}
Restart syslog and LDAP daemons
/etc/init.d/syslog restart
/etc/init.d/ldap restart

2 comments:

Justin Edmands said...

thanks. very easy to follow and it works well.

Justin Edmands said...

thanks. very easy to follow and it works well.