Add configurable log for storage server

This patch add configurable log for swift account/container/object
server service.
Partially implements blueprint puppet-swift-log-support.

Change-Id: Ib3db483dfbad97f23ab7ba2068632856b5e00f11
This commit is contained in:
newptone 2013-06-25 14:48:22 +08:00 committed by Gerrit Code Review
parent c8936fea9b
commit 6a0e505ee9
5 changed files with 25 additions and 1 deletions

View File

@ -18,6 +18,8 @@ define swift::storage::server(
$updater_concurrency = $::processorcount, $updater_concurrency = $::processorcount,
$reaper_concurrency = $::processorcount, $reaper_concurrency = $::processorcount,
$log_facility = "LOG_LOCAL2", $log_facility = "LOG_LOCAL2",
$log_level = "INFO",
$log_address = "/dev/log",
# this parameters needs to be specified after type and name # this parameters needs to be specified after type and name
$config_file_path = "${type}-server/${name}.conf" $config_file_path = "${type}-server/${name}.conf"
) { ) {

View File

@ -145,7 +145,13 @@ describe 'swift::storage::server' do
.with_content(/^user\s*=\s*swift\s*$/) .with_content(/^user\s*=\s*swift\s*$/)
} }
it { should contain_file(fragment_file) \ it { should contain_file(fragment_file) \
.with_content(/^log_facility\s*=\s*LOG_LOCAL2\s*$/) .with_content(/^set log_facility\s*=\s*LOG_LOCAL2\s*$/)
}
it { should contain_file(fragment_file) \
.with_content(/^set log_level\s*=\s*INFO\s*$/)
}
it { should contain_file(fragment_file) \
.with_content(/^set log_address\s*=\s*\/dev\/log\s*$/)
} }
it { should contain_file(fragment_file) \ it { should contain_file(fragment_file) \
.with_content(/^workers\s*=\s*1\s*$/) .with_content(/^workers\s*=\s*1\s*$/)

View File

@ -12,6 +12,12 @@ pipeline = <%= @pipeline.to_a.join(' ') %>
[app:account-server] [app:account-server]
use = egg:swift#account use = egg:swift#account
set log_name = account-server
set log_facility = <%= log_facility %>
set log_level = <%= log_level %>
set log_requests = True
set log_address = <%= log_address %>
[account-replicator] [account-replicator]
concurrency = <%= @replicator_concurrency %> concurrency = <%= @replicator_concurrency %>

View File

@ -13,6 +13,11 @@ pipeline = <%= @pipeline.to_a.join(' ') %>
[app:container-server] [app:container-server]
use = egg:swift#container use = egg:swift#container
set log_name = container-server
set log_facility = <%= log_facility %>
set log_level = <%= log_level %>
set log_requests = True
set log_address = <%= log_address %>
[container-replicator] [container-replicator]
concurrency = <%= @replicator_concurrency %> concurrency = <%= @replicator_concurrency %>

View File

@ -12,6 +12,11 @@ pipeline = <%= @pipeline.to_a.join(' ') %>
[app:object-server] [app:object-server]
use = egg:swift#object use = egg:swift#object
set log_name = object-server
set log_facility = <%= log_facility %>
set log_level = <%= log_level %>
set log_requests = True
set log_address = <%= log_address %>
[object-replicator] [object-replicator]
concurrency = <%= @replicator_concurrency %> concurrency = <%= @replicator_concurrency %>