You are not logged in.
Pages: 1
In pull #225 I try to implement a manual log rotation feature.
I'm plane to use it in a SIGHUP signal handler to release a log file descriptor. By Unix convention in response to SIGHUP signal daemon should reload configuration and reopen all opened files.
This is VERY useful on a big production in case we need to get a full log for a some period of time. In my case if I enable all log levels I got > 100Mb of logs per MINUTE, so having it always ON is very expensive. So I implement a SIGHUP handler what load a new logLevels form a daemon config and call TSynLog.ForceRotation to create a new log file with a new log levels.
As a side effect with a combination of custom OnRotate handler + ForceRotation we can use a Unix logrotate for complex log rotation scenarios (see short explanation why handle SIGHUP for logrotate)
Last edited by mpv (2019-07-26 10:56:36)
Offline
Offline
Nice feature!
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
Pages: 1