Browse Source

Add dateext and related parameters for logrotate

logrotate.pp should support dateext and related parameters.
By this change, a filename of a rotated file can be easily distinguished
by rotated date.

Change-Id: I798304a472df41b86a88611c97c2c99131faa0ad
(cherry picked from commit 1eafeb67bf)
(cherry picked from commit 964fe8cc62)
(cherry picked from commit 9d62bf52a4)
changes/29/670929/1
Keigo Noha 2 years ago
parent
commit
c939f4e61d
  1. 15
      manifests/profile/base/logging/logrotate.pp
  2. 5
      releasenotes/notes/add-dateext-and-related-parameters-58dd288c74b818f7.yaml
  3. 9
      templates/logrotate/containers_logrotate.conf.erb

15
manifests/profile/base/logging/logrotate.pp

@ -79,6 +79,18 @@
# Configures forced purge period for rotated logs.
# Overrides the rotation and rotate settings.
#
# [*dateext*]
# (optional) Defaults to undef.
# Configures the dateext parameter.
#
# [*dateformat*]
# (optional) Defaults to undef.
# Configures the dateformat parameter used with dateext parameter.
#
# [*dateyesterday*]
# (optional) Defaults to undef.
# Configures the dateyesterday parameter used with dateext parameter.
#
# DEPRECATED PARAMETERS
#
# [*size*]
@ -102,6 +114,9 @@ class tripleo::profile::base::logging::logrotate (
$maxsize = '10M',
$rotate = 14,
$purge_after_days = 14,
$dateext = undef,
$dateformat = undef,
$dateyesterday = undef,
# DEPRECATED PARAMETERS
$size = undef,
) {

5
releasenotes/notes/add-dateext-and-related-parameters-58dd288c74b818f7.yaml

@ -0,0 +1,5 @@
---
other:
- |
Add dateext and related paramters for containerized logrotate service to
find easily when logfiles were rotated.

9
templates/logrotate/containers_logrotate.conf.erb

@ -19,4 +19,13 @@
<%- if @compress %>
compress
<%- end %>
<%- if @dateext %>
dateext
<%- if @dateformat %>
dateformat <%= @dateformat %>
<%- end %>
<%- if @dateyesterday %>
dateyesterday
<%- end %>
<%- end %>
}
Loading…
Cancel
Save