-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AdHoc (log rotate) Add feature for logrotation
Magento logs should be rotated as they otherwise might grow realy large. This adds the logrotation, if an debian system is used.
- Loading branch information
Showing
3 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
- name: Check if log rotation is installed | ||
stat: | ||
path: /etc/logrotate.d/ | ||
register: log_rotate_stats | ||
|
||
- name: Add logrotation for magento logs | ||
template: | ||
src: "logrotate.j2" | ||
dest: "/etc/logrotate.d/magento2" | ||
owner: "root" | ||
group: "root" | ||
mode: "u=rw,g=r,o=r" | ||
when: log_rotate_stats.stat.isdir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{{ magento_app_root }}/var/log/*log { | ||
weekly | ||
rotate 12 | ||
missingok | ||
notifempty | ||
compress | ||
delaycompress | ||
} | ||
|