Skip to content

Commit e72fa66

Browse files
committed
log rotation: add new builtin rotation method
Signed-off-by: AshFungor <evgenynarkhov2@gmail.com>
1 parent 11ecccf commit e72fa66

File tree

3 files changed

+30
-17
lines changed

3 files changed

+30
-17
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This repository part contains the source code of `The syslog-ng OSE Administrati
1414

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

17-
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).
17+
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).
1818

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

doc/_admin-guide/070_Destinations/040_File/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ destination d_file {
4545

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

5151
Also, after rotating the log files, reload {{ site.product.short_name }} using the

doc/_admin-guide/180_Best_practices_and_examples/004_Configuring_log_rotation.md

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,32 @@
22
title: Configuring log rotation
33
id: adm-pract-rotate
44
description: >-
5-
The {{ site.product.short_name }} application does not rotate logs by itself. This chapter
6-
describes how to use {{ site.product.short_name }} for log rotation.
5+
This chapter describes how to use {{ site.product.short_name }} for log rotation, making use of builtin options
6+
and external tools.
77
---
88

9-
Consider the following approaches:
9+
Log rotation is traditionally only applicable to files and, consequently,
10+
to file destination drivers in {{ site.product.short_name }}. Consider the following approaches:
11+
12+
## Use builtin logrotate() option of file destination driver
13+
14+
- It is available starting with {{ site.product.short_name }} version 4.10 or later.
15+
16+
- It is performed based on file sizes.
17+
18+
- No additional configuration files are required - log rotation is configured
19+
with the rest of {{ site.product.short_name }}. For details, see [[file() destination options]].
20+
21+
## Separate incoming logs based on time, host or other information
22+
23+
- It is ideal for central log servers, where regular restart of
24+
{{ site.product.short_name }} is unfavorable.
25+
26+
- Requires shell scripts or cron jobs to remove old logs.
27+
28+
- It can be done by using macros in the destination name (in the
29+
filename, directory name, or the database table name). (For details
30+
on using macros, see Templates and macros)
1031

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

@@ -20,23 +41,15 @@ Consider the following approaches:
2041
- Requires frequent restart ({{ site.product.short_name }} must be reloaded/restarted
2142
when the files are rotated). After rotating the log files, reload
2243
{{ site.product.short_name }} using the **syslog-ng-ctl reload** command, or use
23-
another method to send a SIGHUP to {{ site.product.short_name }}.
44+
another method to send a SIGHUP to {{ site.product.short_name }}. Alternatively,
45+
starting from {{ site.product.short_name }} version 3.13 or later **syslog-ng-ctl reopen**
46+
may be used to signal file destination drivers to open log files again without stopping
47+
or interrupting the rest of configured log pipes.
2448

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

29-
## Separate incoming logs based on time, host or other information
30-
31-
- It is ideal for central log servers, where regular restart of
32-
{{ site.product.short_name }} is unfavorable.
33-
34-
- Requires shell scripts or cron jobs to remove old logs.
35-
36-
- It can be done by using macros in the destination name (in the
37-
filename, directory name, or the database table name). (For details
38-
on using macros, see Templates and macros
39-
4053
### Example: File destination for log rotation
4154

4255
This sample file destination configuration stores incoming logs in files

0 commit comments

Comments
 (0)