syslog-ng and logrotate
I am using the syslog-ng 3.3.7 version. My question is , can we manage log rotation within the syslog-ng conf file ? Please advice
If you use something like: destination hosts { file("/var/log/syslog-ng/$HOST/$YEAR.$MONTH.$DAY/$FACILITY" It would rotate the client files daily by creating a new folder within the year,month, but you'd need to clear up the files yourself if you're not intending on keeping them, is that what you are after? [ Stu ] On 10/05/2013 10:27, Rakesh Rajasekharan wrote:
I am using the syslog-ng 3.3.7 version. My question is , can we manage log rotation within the syslog-ng conf file ? Please advice
______________________________________________________________________________ Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng FAQ: http://www.balabit.com/wiki/syslog-ng-faq
yes something similar .. but instead of the day, month can we do it based on the size. say once it crosses 1 GB , archive it and have a new log file created. Can we do this from syslog-ng ? On Fri, May 10, 2013 at 3:37 PM, Stuart Green <stuart.green@doccentrics.com>wrote:
If you use something like:
destination hosts { file("/var/log/syslog-ng/$HOST/$YEAR.$MONTH.$DAY/$FACILITY"
It would rotate the client files daily by creating a new folder within the year,month, but you'd need to clear up the files yourself if you're not intending on keeping them, is that what you are after?
[ Stu ]
On 10/05/2013 10:27, Rakesh Rajasekharan wrote:
I am using the syslog-ng 3.3.7 version. My question is , can we manage log rotation within the syslog-ng conf file ? Please advice
______________________________________________________________________________ Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng FAQ: http://www.balabit.com/wiki/syslog-ng-faq
______________________________________________________________________________ Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng FAQ: http://www.balabit.com/wiki/syslog-ng-faq
Rakesh Rajasekharan <rakesh.rajasekharan@gmail.com> writes:
yes something similar .. but instead of the day, month can we do it based on the size. say once it crosses 1 GB , archive it and have a new log file created. Can we do this from syslog-ng ?
No, that is not possible yet. There are plans to add support for it, there was even a patch a year or so ago, but it needs to be cleaned up and updated before proposing it for merging into 3.5. And as such, if and when this feature appears, it won't be in the 3.3 or 3.4 branches. -- |8]
On 2013-05-10, Gergely Nagy wrote:
Rakesh Rajasekharan <rakesh.rajasekharan@gmail.com> writes:
yes something similar .. but instead of the day, month can we do it based on the size. say once it crosses 1 GB , archive it and have a new log file created. Can we do this from syslog-ng ?
No, that is not possible yet. There are plans to add support for it, there was even a patch a year or so ago, but it needs to be cleaned up and updated before proposing it for merging into 3.5. And as such, if and when this feature appears, it won't be in the 3.3 or 3.4 branches.
And until this is implemented, my suggestion is to use logrotate as you'd use with classic BSD syslogd. Don't forget to send SIGHUP to syslog-ng in postrotate hooks. HTH, -- Jakub Jankowski|shasta@toxcorp.com|http://toxcorp.com/ GPG: FCBF F03D 9ADB B768 8B92 BB52 0341 9037 A875 942D
Yup ... got it.. so for now , i need to rely on the logrotate outside of syslog-ng.... Thanks, Rakesh. On Fri, May 10, 2013 at 6:50 PM, Jakub Jankowski <shasta@toxcorp.com> wrote:
On 2013-05-10, Gergely Nagy wrote:
Rakesh Rajasekharan <rakesh.rajasekharan@gmail.com> writes:
yes something similar .. but instead of the day, month can we do it based on the size. say once it crosses 1 GB , archive it and have a new log file created. Can we do this from syslog-ng ?
No, that is not possible yet. There are plans to add support for it, there was even a patch a year or so ago, but it needs to be cleaned up and updated before proposing it for merging into 3.5. And as such, if and when this feature appears, it won't be in the 3.3 or 3.4 branches.
And until this is implemented, my suggestion is to use logrotate as you'd use with classic BSD syslogd. Don't forget to send SIGHUP to syslog-ng in postrotate hooks.
HTH,
-- Jakub Jankowski|shasta@toxcorp.com|http://toxcorp.com/ GPG: FCBF F03D 9ADB B768 8B92 BB52 0341 9037 A875 942D
______________________________________________________________________________ Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng FAQ: http://www.balabit.com/wiki/syslog-ng-faq
participants (4)
-
Gergely Nagy
-
Jakub Jankowski
-
Rakesh Rajasekharan
-
Stuart Green