Add configurable log for proxy-server service

This patch add configurable log for swift proxy-server service.
And add related spec test.

Partially implements blueprint puppet-swift-log-support.

Change-Id: I385093b3e63f8210d83ec125e6d2578b06b631d4
This commit is contained in:
newptone 2013-06-13 18:57:27 +08:00 committed by Gerrit Code Review
parent e41a552afe
commit b4584daaae
3 changed files with 30 additions and 1 deletions

View File

@ -45,7 +45,13 @@ class swift::proxy(
$workers = $::processorcount,
$allow_account_management = true,
$account_autocreate = true,
$log_headers = 'False',
$log_udp_host = '',
$log_udp_port = '',
$log_address = '/dev/log',
$log_level = 'INFO',
$log_facility = 'LOG_LOCAL1',
$log_handoffs = true,
$package_ensure = 'present'
) {

View File

@ -63,11 +63,19 @@ describe 'swift::proxy' do
'bind_port = 8080',
"workers = #{facts[:processorcount]}",
'user = swift',
'log_name = swift',
'log_level = INFO',
'log_headers = False',
'log_address = /dev/log',
'[pipeline:main]',
'pipeline = healthcheck cache tempauth proxy-server',
'[app:proxy-server]',
'use = egg:swift#proxy',
'set log_name = proxy-server',
'set log_facility = LOG_LOCAL1',
'set log_level = INFO',
'set log_address = /dev/log',
'log_handoffs = true',
'allow_account_management = true',
'account_autocreate = true'
]

View File

@ -7,13 +7,28 @@ bind_ip = <%= @proxy_local_net_ip %>
<% end %>
workers = <%= @workers %>
user = swift
log_name = swift
log_facility = <%= @log_facility %>
log_level = <%= @log_level %>
log_headers = <%= @log_headers %>
log_address = <%= @log_address %>
<% if @log_udp_host != '' -%>
# If set, log_udp_host will override log_address
log_udp_host = <%= @log_udp_host -%>
<% end %>
<% if @log_udp_host !='' and @log_udp_port != '' -%>
log_udp_port = <%= @log_udp_port -%>
<% end %>
[pipeline:main]
pipeline = <%= @pipeline.to_a.join(' ') %>
[app:proxy-server]
use = egg:swift#proxy
set log_name = proxy-server
set log_facility = <%= @log_facility %>
set log_level = <%= @log_level %>
set log_address = <%= @log_address %>
log_handoffs = <%= @log_handoffs %>
allow_account_management = <%= @allow_account_management %>
account_autocreate = <%= @account_autocreate %>