Symas OpenLDAP Knowledge Base

Troubleshooting Logging

Created by Greg Noe, last modified on Nov 07, 2016

  • Regular vs. debug mode

  • Default message destinations

  • Refer to [[[DRAFT] Logging Configuration|6193353]]

  • Test logging using logger

  • Timestamp formatting

 

 

Timestamp Formatting

Under certain conditions (WTH are they???) the timstamp for log entries will appear as an eight character hexidecimal string at the start of the line.  This string is a Unix epoch timestamp in hexadecimal format.  The following perl one-liner can be used to convert the timestamps in a file to a more human-readable format:

Hex Timestamp Conversion

# Use "-pi" instead of "-p" if you want a backup copy of the logfile before it's converted.
perl -p -e 'use POSIX "strftime"; s/^([[:xdigit:]]{8})/POSIX::strftime("%F %T", gmtime(hex $1))/ge' <your-logfile>.log

 

Step-by-step guide