Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This repository part contains the source code of `The syslog-ng OSE Administrati

## [Developer guide](https://syslog-ng.github.io/dev-guide/README)

Do you like adding your idea, bug-fix to the fabolous syslog-ng? Help others to do the same, share your knwowledge in the [developer guide](https://syslog-ng.github.io/dev-guide/README).
Do you like adding your idea, bug-fix to the fabulous syslog-ng? Help others to do the same, share your knowledge in the [developer guide](https://syslog-ng.github.io/dev-guide/README).

## [Generated document](https://syslog-ng.github.io/)

Expand Down
2 changes: 1 addition & 1 deletion doc/_admin-guide/070_Destinations/040_File/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ destination d_file {

**NOTE:** When using this destination, update the configuration of your log
rotation program to rotate these files. Otherwise, the log files can
become very large.
become very large. See Configuring log rotation for available options.
{: .notice--info}

Also, after rotating the log files, reload {{ site.product.short_name }} using the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,32 @@
title: Configuring log rotation
id: adm-pract-rotate
description: >-
The {{ site.product.short_name }} application does not rotate logs by itself. This chapter
describes how to use {{ site.product.short_name }} for log rotation.
This chapter describes how to use {{ site.product.short_name }} for log rotation, making use of builtin options
and external tools.
---

Consider the following approaches:
Log rotation is traditionally only applicable to files and, consequently,
to file destination drivers in {{ site.product.short_name }}. Consider the following approaches:

## Use builtin logrotate() option of file destination driver

- It is available starting with {{ site.product.short_name }} version 4.10 or later.

- It is performed based on file sizes.

- No additional configuration files are required - log rotation is configured
with the rest of {{ site.product.short_name }}. For details, see file() destination options.

## Separate incoming logs based on time, host or other information

- It is ideal for central log servers, where regular restart of
{{ site.product.short_name }} is unfavorable.

- Requires shell scripts or cron jobs to remove old logs.

- It can be done by using macros in the destination name (in the
filename, directory name, or the database table name). (For details
on using macros, see Templates and macros)

## Use logrotate together with {{ site.product.short_name }}

Expand All @@ -17,26 +38,17 @@ Consider the following approaches:
- Less scripting is required, only logrotate has to be configured
correctly.

- Requires frequent restart ({{ site.product.short_name }} must be reloaded/restarted
when the files are rotated). After rotating the log files, reload
- Starting from {{ site.product.short_name }} version 3.13 or later **syslog-ng-ctl reopen**
must be used to signal file destination drivers to open log files again without stopping
or interrupting the rest of configured log pipes. Alternately, {{ site.product.short_name }} can
be reloaded/restarted when the files are rotated. After rotating the log files, reload
{{ site.product.short_name }} using the **syslog-ng-ctl reload** command, or use
another method to send a SIGHUP to {{ site.product.short_name }}.
another method to send a SIGHUP to {{ site.product.short_name }}

- The statistics collected by {{ site.product.short_name }}, and the correlation
information gathered with Pattern Database, are lost with each
restart.

## Separate incoming logs based on time, host or other information

- It is ideal for central log servers, where regular restart of
{{ site.product.short_name }} is unfavorable.

- Requires shell scripts or cron jobs to remove old logs.

- It can be done by using macros in the destination name (in the
filename, directory name, or the database table name). (For details
on using macros, see Templates and macros

### Example: File destination for log rotation

This sample file destination configuration stores incoming logs in files
Expand Down