2.6. Replacing Log Files with a Named Pipe
- Logging certain events, like failed bind attempts or connections from specific users or IP addresses
- Logging entries which match a specific regular expression pattern
- Keeping the log to a certain length (logging only the last number of lines)
- Sending a notification, such as an email, when an event occurs
ds-logpipe.py
named_pipe
[
--user pipe_user
] [
--maxlines number
] [[
--serverpidfile file.pid
] | [
--serverpid PID
]] [
--servertimeout seconds
] [
--plugin=/path/to/plugin.py
| [
pluginfile.arg=value
]]
logconv.pl) that expect to access a real file will fail.
- The log file to use has to be changed to the pipe (
nsslapd-*log) - Buffering should be disabled because the script already buffers the log entries (
nsslapd-*log-logbuffering) - Log rotation should be disabled so that the server does not attempt to rotate the named pipe (
nsslapd-*log-maxlogsperdir,nsslapd-*log-logexpirationtime, andnsslapd-*log-logrotationtime)
ldapmodify.
access.pipe:
# ldapmodify -D "cn=Directory Manager" -W -p 389 -h server.example.com -x dn: cn=config changetype: modify replace: nsslapd-accesslog nsslapd-accesslog: /var/log/dirsrv/slapd-instance/access.pipe - replace: nsslapd-accesslog-logbuffering nsslapd-accesslog-logbuffering: off - replace: nsslapd-accesslog-maxlogsperdir nsslapd-accesslog-maxlogsperdir: 1 - replace: nsslapd-accesslog-logexpirationtime nsslapd-accesslog-logexpirationtime: -1 - replace: nsslapd-accesslog-logrotationtime nsslapd-accesslog-logexpirationtime: -1
Note
-f option will cause the server to close the current log file and switch to the named pipe immediately. This can be very helpful for debugging a running server and sifting the log output for specific messages.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.