Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
Add dateext and related parameters for logrotate
Browse files Browse the repository at this point in the history
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
  • Loading branch information
knoha-rh committed Jul 8, 2019
1 parent bcb1711 commit 1eafeb6
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
15 changes: 15 additions & 0 deletions manifests/profile/base/logging/logrotate.pp
Expand Up @@ -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*]
Expand All @@ -102,6 +114,9 @@
$maxsize = '10M',
$rotate = 14,
$purge_after_days = 14,
$dateext = undef,
$dateformat = undef,
$dateyesterday = undef,
# DEPRECATED PARAMETERS
$size = undef,
) {
Expand Down
@@ -0,0 +1,5 @@
---
other:
- |
Add dateext and related paramters for containerized logrotate service to
find easily when logfiles were rotated.
9 changes: 9 additions & 0 deletions templates/logrotate/containers_logrotate.conf.erb
Expand Up @@ -19,4 +19,13 @@
<%- if @compress %>
compress
<%- end %>
<%- if @dateext %>
dateext
<%- if @dateformat %>
dateformat <%= @dateformat %>
<%- end %>
<%- if @dateyesterday %>
dateyesterday
<%- end %>
<%- end %>
}

0 comments on commit 1eafeb6

Please sign in to comment.