I am trying to implement a simple syslog server (UDP based). On this , we are trying to implment SYSLOG rotation feature. Currently the roatation of logs is done by rename C API.

By doing this we achieve only renaming the syslog file names. Not the syslog file which is residing inside the gzip file.

So I am trying to understand what is the procedure followed in Linux so that syslog roatation can be implemented for my Windows project.

1 Answer 1


Usually logfile rotation is handled outside the syslog daemon by e.g. the logrotate tool. After rotation a signal is sent to the syslog daemon to reopen all logfiles. This works fine under linux/unix, as it's not a problem to rename files that are opened by other processes; I understand that in Windows this could be more problematic.

EDIT: the logfiles are renamed, e.g. daemon.log becomes daemon.log.0 or (preferably) daemon.log.20150423. Either immediately or one cycle later the rotated file is compressed with gzip although that technically has nothing to do with logfile rotation itself, it's just for freeing up space and you could choose to save time and not to do the compression, given today's terabyte disks.

  • GZ : gzip format..i am cofused how they rename the syslog file which resides inside GZIP file.
    – Ragav
    Apr 23, 2015 at 7:31
  • 1
    There is no file residing inside a gzip file; the gzip file is the file but compressed. It has no own name (well, technically the original name can be recorded but in practice that's never used).
    – wurtel
    Apr 23, 2015 at 7:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .