Merge "Support customizing log_max_line_length"

This commit is contained in:
Zuul 2024-10-28 15:47:28 +00:00 committed by Gerrit Code Review
commit f9554393fd
10 changed files with 57 additions and 15 deletions

View File

@ -103,6 +103,10 @@
# (optional) Location where syslog sends the logs to.
# Defaults to '/dev/log'.
#
# [*log_max_line_length*]
# (optional) Caps the length of log lines to the value given.
# Defaults to $facts['os_service_default'].
#
# [*purge_config*]
# (optional) Whether to set only the specified config options
# in the proxy config.
@ -129,6 +133,7 @@ class swift::containerreconciler(
$log_level = 'INFO',
$log_facility = 'LOG_LOCAL2',
$log_address = '/dev/log',
$log_max_line_length = $facts['os_service_default'],
Boolean $purge_config = false,
) inherits swift::params {
@ -186,17 +191,18 @@ class swift::containerreconciler(
}
swift_container_reconciler_config {
'pipeline:main/pipeline': value => join($pipeline, ' ');
'container-reconciler/interval': value => $interval;
'container-reconciler/concurrency': value => $concurrency;
'container-reconciler/process': value => $process;
'container-reconciler/processes': value => $processes;
'container-reconciler/reclaim_age': value => $reclaim_age;
'container-reconciler/request_tries': value => $request_tries;
'container-reconciler/log_name': value => $log_name;
'container-reconciler/log_facility': value => $log_facility;
'container-reconciler/log_level': value => $log_level;
'container-reconciler/log_address': value => $log_address;
'pipeline:main/pipeline': value => join($pipeline, ' ');
'container-reconciler/interval': value => $interval;
'container-reconciler/concurrency': value => $concurrency;
'container-reconciler/process': value => $process;
'container-reconciler/processes': value => $processes;
'container-reconciler/reclaim_age': value => $reclaim_age;
'container-reconciler/request_tries': value => $request_tries;
'container-reconciler/log_name': value => $log_name;
'container-reconciler/log_facility': value => $log_facility;
'container-reconciler/log_level': value => $log_level;
'container-reconciler/log_address': value => $log_address;
'container-reconciler/log_max_line_length': value => $log_max_line_length;
}
if $manage_service {

View File

@ -109,6 +109,10 @@
# (optional) Location where syslog sends the logs to.
# Defaults to '/dev/log'.
#
# [*log_max_line_length*]
# (optional) Caps the length of log lines to the value given.
# Defaults to $facts['os_service_default'].
#
# [*purge_config*]
# (optional) Whether to set only the specified config options
# in the object expirer config.
@ -137,6 +141,7 @@ class swift::objectexpirer(
$log_level = 'INFO',
$log_facility = 'LOG_LOCAL2',
$log_address = '/dev/log',
$log_max_line_length = $facts['os_service_default'],
Boolean $purge_config = false,
) inherits swift::params {
@ -217,6 +222,7 @@ class swift::objectexpirer(
'object-expirer/log_facility': value => $log_facility;
'object-expirer/log_level': value => $log_level;
'object-expirer/log_address': value => $log_address;
'object-expirer/log_max_line_length': value => $log_max_line_length;
}
if $manage_service {

View File

@ -75,6 +75,10 @@
# (optional) Configures log_name for swift proxy-server.
# Defaults to proxy-server
#
# [*log_max_line_length*]
# (optional) Caps the length of log lines to the value given.
# Defaults to $facts['os_service_default'].
#
# [*object_chunk_size*]
# (optional) Chunk size to read from object servers.
# Defaults to $facts['os_service_default'].
@ -212,6 +216,7 @@ class swift::proxy(
$log_facility = 'LOG_LOCAL2',
$log_handoffs = $facts['os_service_default'],
$log_name = 'proxy-server',
$log_max_line_length = $facts['os_service_default'],
$cors_allow_origin = $facts['os_service_default'],
$strict_cors_mode = $facts['os_service_default'],
$cors_expose_headers = $facts['os_service_default'],
@ -292,6 +297,7 @@ class swift::proxy(
'DEFAULT/log_address': value => $log_address;
'DEFAULT/log_udp_host': value => $log_udp_host;
'DEFAULT/log_udp_port': value => $log_udp_port;
'DEFAULT/log_max_line_length': value => $log_max_line_length;
'DEFAULT/client_timeout': value => $client_timeout;
'DEFAULT/keepalive_timeout': value => $keepalive_timeout;
'pipeline:main/pipeline': value => join($pipeline, ' ');

View File

@ -53,6 +53,10 @@
# (Optional) Port value for UDP receiver, if enabled.
# Defaults to undef.
#
# [*log_max_line_length*]
# (Optional) Caps the length of log lines to the value given.
# Defaults to $facts['os_service_default'].
#
# [*device_dir*]
# (Optional) Directory devices are mounted under
# Defaults to $facts['os_service_default'].
@ -112,6 +116,7 @@ class swift::storage::drive_audit(
$log_name = 'drive-audit',
$log_udp_host = undef,
$log_udp_port = undef,
$log_max_line_length = $facts['os_service_default'],
$device_dir = '/srv/node',
$minutes = $facts['os_service_default'],
$error_limit = $facts['os_service_default'],
@ -142,10 +147,11 @@ class swift::storage::drive_audit(
swift_drive_audit_config {
'drive-audit/log_name' : value => $log_name;
'drive-audit/log_facility': value => $log_facility;
'drive-audit/log_level' : value => $log_level;
'drive-audit/log_address' : value => $log_address;
'drive-audit/log_name' : value => $log_name;
'drive-audit/log_facility' : value => $log_facility;
'drive-audit/log_level' : value => $log_level;
'drive-audit/log_address' : value => $log_address;
'drive-audit/log_max_line_length' : value => $log_max_line_length;
}
if $log_udp_host {

View File

@ -190,6 +190,10 @@
# (optional) Port value for UDP receiver, if enabled.
# Defaults to undef.
#
# [*log_max_line_length*]
# (optional) Caps the length of log lines to the value given.
# Defaults to $facts['os_service_default'].
#
# [*log_requests*]
# (optional) Whether or not log every request. reduces logging output if false,
# good for seeing errors if true
@ -327,6 +331,7 @@ define swift::storage::server(
$log_udp_host = $facts['os_service_default'],
$log_udp_port = $facts['os_service_default'],
$log_requests = true,
$log_max_line_length = $facts['os_service_default'],
# this parameters needs to be specified after type and name
Boolean $statsd_enabled = false,
$log_statsd_host = 'localhost',
@ -443,6 +448,7 @@ define swift::storage::server(
'DEFAULT/log_address' => {'value' => $log_address},
'DEFAULT/log_udp_host' => {'value' => $log_udp_host},
'DEFAULT/log_udp_port' => {'value' => $log_udp_port},
'DEFAULT/log_max_line_length' => {'value' => $log_max_line_length},
# pipeline
'pipeline:main/pipeline' => {'value' => join($pipeline, ' ')},
# server

View File

@ -0,0 +1,4 @@
---
features:
- |
The new ``log_max_line_length`` parameter has been added.

View File

@ -42,6 +42,8 @@ describe 'swift::containerreconciler' do
'container-reconciler/log_facility').with_value('LOG_LOCAL2')
is_expected.to contain_swift_container_reconciler_config(
'container-reconciler/log_address').with_value('/dev/log')
is_expected.to contain_swift_container_reconciler_config(
'container-reconciler/log_max_line_length').with_value('<SERVICE DEFAULT>')
is_expected.to contain_swift_container_reconciler_config(
'filter:cache/memcache_servers').with_value('127.0.0.1:11211')
is_expected.to contain_swift_container_reconciler_config(

View File

@ -46,6 +46,8 @@ describe 'swift::objectexpirer' do
'object-expirer/log_facility').with_value('LOG_LOCAL2')
is_expected.to contain_swift_object_expirer_config(
'object-expirer/log_address').with_value('/dev/log')
is_expected.to contain_swift_object_expirer_config(
'object-expirer/log_max_line_length').with_value('<SERVICE DEFAULT>')
is_expected.to contain_swift_object_expirer_config(
'filter:cache/memcache_servers').with_value('127.0.0.1:11211')
is_expected.to contain_swift_object_expirer_config(

View File

@ -16,6 +16,7 @@ describe 'swift::storage::drive_audit' do
should contain_swift_drive_audit_config('drive-audit/log_facility').with_value('LOG_LOCAL2')
should contain_swift_drive_audit_config('drive-audit/log_level').with_value('INFO')
should contain_swift_drive_audit_config('drive-audit/log_address').with_value('/dev/log')
should contain_swift_drive_audit_config('drive-audit/log_max_line_length').with_value('<SERVICE DEFAULT>')
should contain_swift_drive_audit_config('drive-audit/log_udp_host').with_value('<SERVICE DEFAULT>')
should contain_swift_drive_audit_config('drive-audit/log_udp_port').with_value('<SERVICE DEFAULT>')

View File

@ -83,6 +83,7 @@ describe 'swift::storage::server' do
is_expected.to contain_swift_account_config('DEFAULT/log_address').with_value('/dev/log')
is_expected.to contain_swift_account_config('DEFAULT/log_udp_host').with_value('<SERVICE DEFAULT>')
is_expected.to contain_swift_account_config('DEFAULT/log_udp_port').with_value('<SERVICE DEFAULT>')
is_expected.to contain_swift_account_config('DEFAULT/log_max_line_length').with_value('<SERVICE DEFAULT>')
is_expected.to contain_swift_account_config('pipeline:main/pipeline').with_value('account-server')
is_expected.to contain_swift_account_config('app:account-server/use').with_value('egg:swift#account')
is_expected.to contain_swift_account_config('app:account-server/set log_name').with_value('account-server')
@ -273,6 +274,7 @@ describe 'swift::storage::server' do
is_expected.to contain_swift_container_config('DEFAULT/log_address').with_value('/dev/log')
is_expected.to contain_swift_container_config('DEFAULT/log_udp_host').with_value('<SERVICE DEFAULT>')
is_expected.to contain_swift_container_config('DEFAULT/log_udp_port').with_value('<SERVICE DEFAULT>')
is_expected.to contain_swift_container_config('DEFAULT/log_max_line_length').with_value('<SERVICE DEFAULT>')
is_expected.to contain_swift_container_config('pipeline:main/pipeline').with_value('container-server')
is_expected.to contain_swift_container_config('app:container-server/use').with_value('egg:swift#container')
is_expected.to contain_swift_container_config('app:container-server/set log_name').with_value('container-server')
@ -468,6 +470,7 @@ describe 'swift::storage::server' do
is_expected.to contain_swift_object_config('DEFAULT/log_address').with_value('/dev/log')
is_expected.to contain_swift_object_config('DEFAULT/log_udp_host').with_value('<SERVICE DEFAULT>')
is_expected.to contain_swift_object_config('DEFAULT/log_udp_port').with_value('<SERVICE DEFAULT>')
is_expected.to contain_swift_object_config('DEFAULT/log_max_line_length').with_value('<SERVICE DEFAULT>')
is_expected.to contain_swift_object_config('pipeline:main/pipeline').with_value('object-server')
is_expected.to contain_swift_object_config('app:object-server/use').with_value('egg:swift#object')
is_expected.to contain_swift_object_config('app:object-server/set log_name').with_value('object-server')