[syslog-ng] How to rotate log file in syslog-ng file based on file size

Gergely Nagy algernon at balabit.hu
Tue Apr 17 12:36:19 CEST 2012


Balbir Singh <sbalbir at nic.in> writes:

> Dear Team,
>
> I am receiving a log of around 80GB per day.
> I want to make a log file of fixed size (suppose 10Gb) and after that file size crossed, new file should be created.
>
>
> How to do that?

At the moment, this is not possible with syslog-ng alone. You can use
logrotate, the 'size' option of it in particular, to achieve what you
want.

Something like:

/var/log/big-logs/* {
  size 10G
  postrotate
    /etc/init.d/syslog-ng reload
  endscript
  rotate 100
  missingok
}

It might be worth changing the destination in your config to use a
flatter structure, so logrotate can do it's job.

-- 
|8]



More information about the syslog-ng mailing list