blob: ad9cdbb5fefdb1928f2f09f30220961a2c8e757d [file] [log] [blame]
Filip Pytlound5d7cc42016-05-16 10:56:18 +02001======================
2Salt Logrotate Formula
3======================
4
5Logrotate is designed to ease administration of systems that generate
6large numbers of log files. It allows automatic rotation, compression,
7removal, and mailing of log files. Each log file may be handled daily,
8weekly, monthly, or when it grows too large.
9
10Example pillar
11==============
12
13Configuration for syslog from Ubuntu 14.04 (trusty):
14
Filip Pytloundf5dc312016-05-16 11:46:06 +020015.. code-block:: yaml
16
17 logrotate:
18 server:
19 enabled: true
20 job:
21 rsyslog:
22 - files:
23 - /var/log/mail.info
24 - /var/log/mail.warn
25 - /var/log/mail.err
26 - /var/log/mail.log
27 - /var/log/daemon.log
28 - /var/log/kern.log
29 - /var/log/auth.log
30 - /var/log/user.log
31 - /var/log/lpr.log
32 - /var/log/cron.log
33 - /var/log/debug
34 - /var/log/messages
35 options:
36 - rotate: 4
37 - weekly
38 - missingok
39 - notifempty
40 - compress
41 - delaycompress
42 - sharedscripts
43 - postrotate: "reload rsyslog >/dev/null 2>&1 || true"
44 - files:
45 - /var/log/syslog
46 options:
47 - rotate: 7
48 - daily
49 - missingok
50 - notifempty
51 - delaycompress
52 - compress
53 - postrotate: "reload rsyslog >/dev/null 2>&1 || true"
Filip Pytlound5d7cc42016-05-16 10:56:18 +020054
Filip Pytloun563a9d22017-06-23 15:22:37 +020055Cross-formula relationship
56==========================
57
58It's possible to use support meta to define logrotate rules from within other
59formula.
60
61Example ``meta/logrotate.yml`` for horizon formula:
62
63.. code-block:: yaml
64
65 job:
66 horizon:
67 - files:
68 - /var/log/horizon/*.log
69 options:
70 - compress
71 - delaycompress
72 - missingok
73 - notifempty
74 - rotate: 10
75 - daily
76 - minsize: 20M
77 - maxsize: 500M
78 - postrotate: "if /etc/init.d/apache2 status > /dev/null; then /etc/init.d/apache2 reload > /dev/null; fi"
79
Filip Pytlound5d7cc42016-05-16 10:56:18 +020080Reference
81=========
82
83- http://www.linuxcommand.org/man_pages/logrotate8.html
Filip Pytloun5b311d62017-02-02 13:02:03 +010084
85Documentation and Bugs
86======================
87
88To learn how to install and update salt-formulas, consult the documentation
89available online at:
90
91 http://salt-formulas.readthedocs.io/
92
93In the unfortunate event that bugs are discovered, they should be reported to
94the appropriate issue tracker. Use Github issue tracker for specific salt
95formula:
96
97 https://github.com/salt-formulas/salt-formula-logrotate/issues
98
99For feature requests, bug reports or blueprints affecting entire ecosystem,
100use Launchpad salt-formulas project:
101
102 https://launchpad.net/salt-formulas
103
104You can also join salt-formulas-users team and subscribe to mailing list:
105
106 https://launchpad.net/~salt-formulas-users
107
108Developers wishing to work on the salt-formulas projects should always base
109their work on master branch and submit pull request against specific formula.
110
111 https://github.com/salt-formulas/salt-formula-logrotate
112
113Any questions or feedback is always welcome so feel free to join our IRC
114channel:
115
116 #salt-formulas @ irc.freenode.net