| ## Default: Daily rotation with 28 rotations kept |
| {%- from "gnocchi/map.jinja" import server, client with context %} |
| |
| {%- if server.get('enabled', False) %} |
| {%- set log_interval = server.get('logrotate', {}).get('interval', 'daily') %} |
| {%- set log_rotation = server.get('logrotate', {}).get('rotate', 28) %} |
| {%- elif client.get('enabled', False) %} |
| {%- set log_interval = client.get('logrotate', {}).get('interval', 'daily') %} |
| {%- set log_rotation = client.get('logrotate', {}).get('rotate', 28) %} |
| {%- endif %} |
| |
| |
| {%- if server.get('enabled', False) or client.get('enabled', False) %} |
| job: |
| gnocchi-common: |
| - files: |
| - /var/log/gnocchi/*.log |
| options: |
| - {{ log_interval }} |
| - rotate: {{ log_rotation }} |
| - missingok |
| - compress |
| - delaycompress |
| - copytruncate |
| {%- endif %} |