From dd667a642c7c4a690d4d232ce0f2972191a23bd6 Mon Sep 17 00:00:00 2001 From: Christian Elberfeld <elberfeld@web.de> Date: Fri, 21 Jul 2023 23:22:42 +0200 Subject: [PATCH] Gitlab logrotate settings --- webserver/docker_gitlab/templates/conf/gitlab.rb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/webserver/docker_gitlab/templates/conf/gitlab.rb b/webserver/docker_gitlab/templates/conf/gitlab.rb index 3add34fc..75715fda 100644 --- a/webserver/docker_gitlab/templates/conf/gitlab.rb +++ b/webserver/docker_gitlab/templates/conf/gitlab.rb @@ -1426,17 +1426,27 @@ nginx['proxy_set_headers'] = { ################################################################################ # logging['svlogd_size'] = 200 * 1024 * 1024 # rotate after 200 MB of log data +logging['svlogd_size'] = 200 * 1024 * 1024 # logging['svlogd_num'] = 30 # keep 30 rotated log files +logging['svlogd_num'] = 30 # logging['svlogd_timeout'] = 24 * 60 * 60 # rotate after 24 hours +logging['svlogd_timeout'] = 24 * 60 * 60 # logging['svlogd_filter'] = "gzip" # compress logs with gzip +logging['svlogd_filter'] = "gzip" # logging['svlogd_udp'] = nil # transmit log messages via UDP # logging['svlogd_prefix'] = nil # custom prefix for log messages # logging['logrotate_frequency'] = "daily" # rotate logs daily +logging['logrotate_frequency'] = "daily" # logging['logrotate_maxsize'] = nil # rotate logs when they grow bigger than size bytes even before the specified time interval (daily, weekly, monthly, or yearly) +logging['logrotate_maxsize'] = "200M" # logging['logrotate_size'] = nil # do not rotate by size by default +logging['logrotate_size'] = "50M" # logging['logrotate_rotate'] = 30 # keep 30 rotated logs +logging['logrotate_rotate'] = 30 # logging['logrotate_compress'] = "compress" # see 'man logrotate' +logging['logrotate_compress'] = "compress" # logging['logrotate_method'] = "copytruncate" # see 'man logrotate' +logging['logrotate_method'] = "copytruncate" # logging['logrotate_postrotate'] = nil # no postrotate command by default # logging['logrotate_dateformat'] = nil # use date extensions for rotated files rather than numbers e.g. a value of "-%Y-%m-%d" would give rotated files like production.log-2016-03-09.gz @@ -1458,7 +1468,7 @@ nginx['proxy_set_headers'] = { ##! Docs: https://docs.gitlab.com/omnibus/settings/logs.html#logrotate ##! You can disable built in logrotate feature. ################################################################################ -# logrotate['enable'] = true +logrotate['enable'] = true # logrotate['log_directory'] = "/var/log/gitlab/logrotate" ################################################################################ -- GitLab