[xtrusia,r=james-page] Add support for debug and header logging.
This commit is contained in:
commit
aef4ebdc16
12
config.yaml
12
config.yaml
|
@ -122,6 +122,18 @@ options:
|
||||||
Timeouts from these requests can be recovered from so setting this to
|
Timeouts from these requests can be recovered from so setting this to
|
||||||
something lower than node-timeout would provide quicker error recovery
|
something lower than node-timeout would provide quicker error recovery
|
||||||
while allowing for a longer timeout for non-recoverable requests (PUTs).
|
while allowing for a longer timeout for non-recoverable requests (PUTs).
|
||||||
|
# Logging configuration
|
||||||
|
debug:
|
||||||
|
default: False
|
||||||
|
type: boolean
|
||||||
|
description: |
|
||||||
|
Set log-name, log-facility, log-level, log-address
|
||||||
|
log-headers:
|
||||||
|
default: False
|
||||||
|
type: boolean
|
||||||
|
description: |
|
||||||
|
Enables the ability to log request headers.
|
||||||
|
The default is False.
|
||||||
# Manual Keystone configuration.
|
# Manual Keystone configuration.
|
||||||
keystone-auth-host:
|
keystone-auth-host:
|
||||||
type: string
|
type: string
|
||||||
|
|
|
@ -100,8 +100,14 @@ class SwiftIdentityContext(OSContextGenerator):
|
||||||
'delay_auth_decision': config('delay-auth-decision'),
|
'delay_auth_decision': config('delay-auth-decision'),
|
||||||
'node_timeout': config('node-timeout'),
|
'node_timeout': config('node-timeout'),
|
||||||
'recoverable_node_timeout': config('recoverable-node-timeout'),
|
'recoverable_node_timeout': config('recoverable-node-timeout'),
|
||||||
|
'log_headers': config('log-headers')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if config('debug'):
|
||||||
|
ctxt['log_level'] = 'DEBUG'
|
||||||
|
else:
|
||||||
|
ctxt['log_level'] = 'INFO'
|
||||||
|
|
||||||
# Instead of duplicating code lets use charm-helpers to set signing_dir
|
# Instead of duplicating code lets use charm-helpers to set signing_dir
|
||||||
# TODO(hopem): refactor this context handler to use charm-helpers
|
# TODO(hopem): refactor this context handler to use charm-helpers
|
||||||
# code.
|
# code.
|
||||||
|
|
|
@ -3,6 +3,12 @@ bind_port = {{ bind_port }}
|
||||||
workers = {{ workers }}
|
workers = {{ workers }}
|
||||||
user = swift
|
user = swift
|
||||||
bind_ip = {{ bind_host }}
|
bind_ip = {{ bind_host }}
|
||||||
|
log_name = swift
|
||||||
|
log_facility = LOG_LOCAL0
|
||||||
|
log_level = {{ log_level }}
|
||||||
|
log_address = /dev/log
|
||||||
|
log_headers = {{ log_headers }}
|
||||||
|
|
||||||
{% if ssl %}
|
{% if ssl %}
|
||||||
cert_file = {{ ssl_cert }}
|
cert_file = {{ ssl_cert }}
|
||||||
key_file = {{ ssl_key }}
|
key_file = {{ ssl_key }}
|
||||||
|
@ -10,10 +16,10 @@ key_file = {{ ssl_key }}
|
||||||
|
|
||||||
{% if auth_type == 'keystone' %}
|
{% if auth_type == 'keystone' %}
|
||||||
[pipeline:main]
|
[pipeline:main]
|
||||||
pipeline = gatekeeper healthcheck cache swift3 s3token container_sync bulk tempurl slo dlo formpost authtoken keystoneauth staticweb container-quotas account-quotas proxy-server
|
pipeline = gatekeeper healthcheck proxy-logging cache swift3 s3token container_sync bulk tempurl slo dlo formpost authtoken keystoneauth staticweb container-quotas account-quotas proxy-logging proxy-server
|
||||||
{% else %}
|
{% else %}
|
||||||
[pipeline:main]
|
[pipeline:main]
|
||||||
pipeline = gatekeeper healthcheck cache container_sync bulk tempurl slo dlo formpost tempauth staticweb container-quotas account-quotas proxy-server
|
pipeline = gatekeeper healthcheck proxy-logging cache container_sync bulk tempurl slo dlo formpost tempauth staticweb container-quotas account-quotas proxy-logging proxy-server
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
[app:proxy-server]
|
[app:proxy-server]
|
||||||
|
@ -40,6 +46,9 @@ use = egg:swift#account_quotas
|
||||||
[filter:container-quotas]
|
[filter:container-quotas]
|
||||||
use = egg:swift#container_quotas
|
use = egg:swift#container_quotas
|
||||||
|
|
||||||
|
[filter:proxy-logging]
|
||||||
|
use = egg:swift#proxy_logging
|
||||||
|
|
||||||
[filter:staticweb]
|
[filter:staticweb]
|
||||||
use = egg:swift#staticweb
|
use = egg:swift#staticweb
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,12 @@ bind_port = {{ bind_port }}
|
||||||
workers = {{ workers }}
|
workers = {{ workers }}
|
||||||
user = swift
|
user = swift
|
||||||
bind_ip = {{ bind_host }}
|
bind_ip = {{ bind_host }}
|
||||||
|
log_name = swift
|
||||||
|
log_facility = LOG_LOCAL0
|
||||||
|
log_level = {{ log_level }}
|
||||||
|
log_address = /dev/log
|
||||||
|
log_headers = {{ log_headers }}
|
||||||
|
|
||||||
{% if ssl %}
|
{% if ssl %}
|
||||||
cert_file = {{ ssl_cert }}
|
cert_file = {{ ssl_cert }}
|
||||||
key_file = {{ ssl_key }}
|
key_file = {{ ssl_key }}
|
||||||
|
@ -10,10 +16,10 @@ key_file = {{ ssl_key }}
|
||||||
|
|
||||||
{% if auth_type == 'keystone' %}
|
{% if auth_type == 'keystone' %}
|
||||||
[pipeline:main]
|
[pipeline:main]
|
||||||
pipeline = gatekeeper healthcheck cache swift3 s3token container_sync bulk tempurl slo dlo formpost authtoken keystoneauth staticweb container-quotas account-quotas proxy-server
|
pipeline = gatekeeper healthcheck proxy-logging cache swift3 s3token container_sync bulk tempurl slo dlo formpost authtoken keystoneauth staticweb container-quotas account-quotas proxy-logging proxy-server
|
||||||
{% else %}
|
{% else %}
|
||||||
[pipeline:main]
|
[pipeline:main]
|
||||||
pipeline = gatekeeper healthcheck cache container_sync bulk tempurl slo dlo formpost tempauth staticweb container-quotas account-quotas proxy-server
|
pipeline = gatekeeper healthcheck proxy-logging cache container_sync bulk tempurl slo dlo formpost tempauth staticweb container-quotas account-quotas proxy-logging proxy-server
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
[app:proxy-server]
|
[app:proxy-server]
|
||||||
|
@ -40,6 +46,9 @@ use = egg:swift#account_quotas
|
||||||
[filter:container-quotas]
|
[filter:container-quotas]
|
||||||
use = egg:swift#container_quotas
|
use = egg:swift#container_quotas
|
||||||
|
|
||||||
|
[filter:proxy-logging]
|
||||||
|
use = egg:swift#proxy_logging
|
||||||
|
|
||||||
[filter:staticweb]
|
[filter:staticweb]
|
||||||
use = egg:swift#staticweb
|
use = egg:swift#staticweb
|
||||||
|
|
||||||
|
|
|
@ -368,13 +368,19 @@ class SwiftProxyBasicDeployment(OpenStackAmuletDeployment):
|
||||||
expected = {
|
expected = {
|
||||||
'DEFAULT': {
|
'DEFAULT': {
|
||||||
'bind_port': '8070',
|
'bind_port': '8070',
|
||||||
'user': 'swift'
|
'user': 'swift',
|
||||||
|
'log_name': 'swift',
|
||||||
|
'log_facility': 'LOG_LOCAL0',
|
||||||
|
'log_level': 'INFO',
|
||||||
|
'log_headers': 'False',
|
||||||
|
'log_address': '/dev/log'
|
||||||
},
|
},
|
||||||
'pipeline:main': {
|
'pipeline:main': {
|
||||||
'pipeline': 'gatekeeper healthcheck cache swift3 s3token '
|
'pipeline': 'gatekeeper healthcheck proxy-logging cache swift3 '
|
||||||
'container_sync bulk tempurl slo dlo formpost '
|
's3token container_sync bulk tempurl slo dlo '
|
||||||
'authtoken keystoneauth staticweb '
|
'formpost authtoken keystoneauth staticweb '
|
||||||
'container-quotas account-quotas proxy-server'
|
'container-quotas account-quotas proxy-logging '
|
||||||
|
'proxy-server'
|
||||||
},
|
},
|
||||||
'app:proxy-server': {
|
'app:proxy-server': {
|
||||||
'use': 'egg:swift#proxy',
|
'use': 'egg:swift#proxy',
|
||||||
|
@ -395,6 +401,7 @@ class SwiftProxyBasicDeployment(OpenStackAmuletDeployment):
|
||||||
},
|
},
|
||||||
'filter:account-quotas': {'use': 'egg:swift#account_quotas'},
|
'filter:account-quotas': {'use': 'egg:swift#account_quotas'},
|
||||||
'filter:container-quotas': {'use': 'egg:swift#container_quotas'},
|
'filter:container-quotas': {'use': 'egg:swift#container_quotas'},
|
||||||
|
'filter:proxy-logging': {'use': 'egg:swift#proxy_logging'},
|
||||||
'filter:staticweb': {'use': 'egg:swift#staticweb'},
|
'filter:staticweb': {'use': 'egg:swift#staticweb'},
|
||||||
'filter:bulk': {'use': 'egg:swift#bulk'},
|
'filter:bulk': {'use': 'egg:swift#bulk'},
|
||||||
'filter:slo': {'use': 'egg:swift#slo'},
|
'filter:slo': {'use': 'egg:swift#slo'},
|
||||||
|
|
Loading…
Reference in New Issue