Skip to content
Open
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
1 change: 1 addition & 0 deletions deployment/environments/group_vars/all/vitamui_vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ vitamui_defaults:
jvm_log: false
accesslogs: true
access_retention_days: 365
access_logrotate: enabled # or disabled
log:
logback_max_file_size: "10MB"
logback_max_history: 365
Expand Down
1 change: 1 addition & 0 deletions deployment/roles/vitamui/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jvm_log: "{{ vitamui_defaults.services.jvm_log | default(false) | bool }}"
accesslogs: "{{ vitamui_defaults.services.accesslogs | default('true') | lower }}"
access_retention_days: "{{ vitamui_defaults.services.access_retention_days | default(365) }}"
access_total_size_cap: "{{ vitamui_defaults.services.access_total_size_cap | default('5GB') }}"
access_logrotate: "{{ vitamui_defaults.services.access_logrotate | default('enabled') }}"

log:
logback_max_file_size: "{{ vitamui_defaults.services.log.logback_max_file_size | default('10MB') }}"
Expand Down
15 changes: 15 additions & 0 deletions deployment/roles/vitamui/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -239,3 +239,18 @@
- name: printing error logs
fail:
msg: "{{ journalctl_logs.stdout_lines }}"

- name: Enable logrotate for vitamui
template:
src: logrotate.d.vitamui.j2
dest: /etc/logrotate.d/{{ service_name }}
owner: root
group: root
mode: 0644
when: vitamui_struct.access_logrotate | default(access_logrotate) | lower == 'enabled'

- name: Disable logrotate for vitamui
file:
path: /etc/logrotate.d/{{ service_name }}
state: absent
when: vitamui_struct.access_logrotate | default(access_logrotate) | lower == 'disabled'
9 changes: 9 additions & 0 deletions deployment/roles/vitamui/templates/logrotate.d.vitamui.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{{ vitamui_folder_log }}/accesslog*.log {{ vitamui_folder_log }}/management_accesslog*.log {
daily
rotate {{ vitamui_struct.access_retention_days | default(access_retention_days) }}
compress
missingok
notifempty
create 640 root root
dateext
}
Loading