Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Openldap logs not getting generated [closed]

I have been trying to enable logging in my OpenLDAP setup (in Oracle Enterprise Linux 6.5) , but no logs are being generated in /var/log/slapd/slapd.log.

Followed these steps to enable logging :

  1. Edited the slapd.conf file :

# grep -i loglevel /etc/openldap/slapd.conf

loglevel -1

  1. Did the setup for the log directory in /var/log/slapd # cd /var/log/slapd ; ls -ltr

-rw------- 1 root root 217 May 21 19:48 slapd.log

  1. Edited the rsyslog config file

# grep -i local4 /etc/rsyslog.conf

local4. /var/log/slapd/slapd.log*

  1. restarted the openldap service and also the rsyslogger :

# service rsyslog restart

# service slapd restart

But even after doing these steps , we are not seeing logs captured in the slapd.log file . Only log seen is the below line :

more /var/log/slapd/slapd.log

May 21 19:48:12 sprdneval slapd[2961]: @(#) $OpenLDAP: slapd 2.4.39 (Aug 16 2014 20:41:55) $#012#[email protected] .oracle.com:/builddir/build/BUILD/openldap-2.4.39/openldap-2.4.39/build-servers/servers/slapd

Am i missing to do something blindingly obvious ?

Regards, Hari

like image 380
Harikrishnan V Avatar asked Aug 21 '26 09:08

Harikrishnan V


1 Answers

I see the same issue and posted my question at Serverfault about what '-s' option means.

If you see olcLogLevel setting at current config:

$ sudo grep olcLogLevel /etc/openldap/slapd.d/cn=config.ldif
olcLogLevel: 0

Then, you can change it by:

$ sudo ldapmodify -Y EXTERNAL -H ldapi:/// <<EOF
dn:           cn=config
changetype:   modify
replace:      olcLogLevel
olcLogLevel:  256
EOF

If you don't see olcLogLevel setting, then you need to newly create the entry. I haven't seen the case but I think it will be done by change 'changetype' above from 'modify' to 'add'.

My environment is CentOS7.9 so that the path would be different from yours.

like image 160
Fumisky Wells Avatar answered Aug 22 '26 21:08

Fumisky Wells