Allow to customize log_name for services
This patch allows us to customize log_name for: - proxy-server - container-server - object-server - account-server Which may be usefull for log collecting/parsing. Defaults remain as they were before the patch. Change-Id: I173652ec5bbe8d4382e10db4510d91aebceacab5
This commit is contained in:
parent
3ea0044036
commit
a2cae16d31
@ -34,6 +34,9 @@
|
||||
# Optional but requires write_affinity to be set. Defaults to undef.
|
||||
# [*package_ensure*] Ensure state of the swift proxy package.
|
||||
# Optional. Defaults to present.
|
||||
# [*log_name*]
|
||||
# Configures log_name for swift proxy-server.
|
||||
# Optional. Defaults to proxy-server
|
||||
#
|
||||
# == Examples
|
||||
#
|
||||
@ -59,6 +62,7 @@ class swift::proxy(
|
||||
$log_level = 'INFO',
|
||||
$log_facility = 'LOG_LOCAL1',
|
||||
$log_handoffs = true,
|
||||
$log_name = 'proxy-server',
|
||||
$read_affinity = undef,
|
||||
$write_affinity = undef,
|
||||
$write_affinity_node_count = undef,
|
||||
|
@ -21,6 +21,7 @@ define swift::storage::server(
|
||||
$log_facility = 'LOG_LOCAL2',
|
||||
$log_level = 'INFO',
|
||||
$log_address = '/dev/log',
|
||||
$log_name = "${type}-server",
|
||||
# this parameters needs to be specified after type and name
|
||||
$config_file_path = "${type}-server/${name}.conf"
|
||||
) {
|
||||
|
@ -99,6 +99,7 @@ describe 'swift::proxy' do
|
||||
:allow_account_management => false,
|
||||
:account_autocreate => false,
|
||||
:log_level => 'DEBUG',
|
||||
:log_name => 'swift-proxy-server',
|
||||
:read_affinity => 'r1z1=100, r1=200',
|
||||
:write_affinity => 'r1',
|
||||
:write_affinity_node_count => '2 * replicas',
|
||||
@ -116,6 +117,7 @@ describe 'swift::proxy' do
|
||||
'pipeline = swauth proxy-server',
|
||||
'[app:proxy-server]',
|
||||
'use = egg:swift#proxy',
|
||||
'set log_name = swift-proxy-server',
|
||||
'allow_account_management = false',
|
||||
'account_autocreate = false',
|
||||
'read_affinity = r1z1=100, r1=200',
|
||||
|
@ -151,6 +151,9 @@ describe 'swift::storage::server' do
|
||||
it { should contain_file(fragment_file) \
|
||||
.with_content(/^user\s*=\s*swift\s*$/)
|
||||
}
|
||||
it { should contain_file(fragment_file) \
|
||||
.with_content(/^set log_name\s*=\s*#{t}-server\s*$/)
|
||||
}
|
||||
it { should contain_file(fragment_file) \
|
||||
.with_content(/^set log_facility\s*=\s*LOG_LOCAL2\s*$/)
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ pipeline = <%= @pipeline.to_a.join(' ') %>
|
||||
|
||||
[app:account-server]
|
||||
use = egg:swift#account
|
||||
set log_name = account-server
|
||||
set log_name = <%= @log_name %>
|
||||
set log_facility = <%= @log_facility %>
|
||||
set log_level = <%= @log_level %>
|
||||
set log_requests = True
|
||||
|
@ -14,7 +14,7 @@ pipeline = <%= @pipeline.to_a.join(' ') %>
|
||||
[app:container-server]
|
||||
allow_versions = <%= @allow_versions %>
|
||||
use = egg:swift#container
|
||||
set log_name = @container-server
|
||||
set log_name = <%= @log_name %>
|
||||
set log_facility = <%= @log_facility %>
|
||||
set log_level = <%= @log_level %>
|
||||
set log_requests = True
|
||||
|
@ -12,7 +12,7 @@ pipeline = <%= @pipeline.to_a.join(' ') %>
|
||||
|
||||
[app:object-server]
|
||||
use = egg:swift#object
|
||||
set log_name = object-server
|
||||
set log_name = <%= @log_name %>
|
||||
set log_facility = <%= @log_facility %>
|
||||
set log_level = <%= @log_level %>
|
||||
set log_requests = True
|
||||
|
@ -25,7 +25,7 @@ pipeline = <%= @pipeline.to_a.join(' ') %>
|
||||
|
||||
[app:proxy-server]
|
||||
use = egg:swift#proxy
|
||||
set log_name = proxy-server
|
||||
set log_name = <%= @log_name %>
|
||||
set log_facility = <%= @log_facility %>
|
||||
set log_level = <%= @log_level %>
|
||||
set log_address = <%= @log_address %>
|
||||
|
Loading…
Reference in New Issue
Block a user