[Date Prev][Date Next] [Chronological] [Thread] [Top]

logging



Does anyone have a good solution to log file managment with OpenLDAP 2.1.22?  If I use syslog it goes to a file of my choosing per syslog.conf.  This is fine but I'd like to be able to delete the log file when it gets too big or on restart of the server which means I then have to kill -HUP syslogd to recreate the file.  I'm currently considering using the Apache log rotator (see script below).  Is this good, bad?  Can I accomplish the same with syslogd or some other method?  Is there a difference in efficiency?  This LDAP is backing a 20,000 user mail system with some extras so it produces a fair amount of log information.  Does anyone have a recommended loglevel for production?  I'd like to keep it high to start while we make sure the server is running well.  Thanks for your help!

James Courtney
InPhonic, Inc.
Hayward, CA


<script>
#!/bin/sh

# Basic slapd information
LDAP_HOME=/apps/openldap/2.1.22;
SLAPD=$LDAP_HOME/libexec/slapd;

#LOG_LEVEL=256;
LOG_LEVEL=264;

# Use the Apache log rotator
LOG_ROTATOR=/usr/sbin/rotatelogs;
LOG_BASENAME=$LDAP_HOME/log/slapd.log.%Y%m%dT%H%M%S;
LOG_MAX_SIZE=100M;
# 8 hr. * 60 min./hr. = 2400 min. behind UTC
#TIMEZONE_OFFSET=-480;

$SLAPD -d $LOG_LEVEL 2>&1 | $LOG_ROTATOR $LOG_BASENAME $LOG_MAX_SIZE &
</script>