Add more log options
This adds a few new log options for object-expirer and container-reconciler so that users can set consistent logging options. The default log level of container-reconciler is effectively changed from local0 to local2, to use the consistent log facility in all services. Change-Id: If5c287d8fd1325b08705133756eece6e41cfdc5f
This commit is contained in:
		@@ -87,6 +87,18 @@
 | 
			
		||||
#    is ignored.
 | 
			
		||||
#    Defaults to $facts['os_service_default']
 | 
			
		||||
#
 | 
			
		||||
#  [*log_name*]
 | 
			
		||||
#    (optional) Log name.
 | 
			
		||||
#    Defaults to $facts['os_service_default'].
 | 
			
		||||
#
 | 
			
		||||
#  [*log_level*]
 | 
			
		||||
#    (optional) Log level.
 | 
			
		||||
#    Defaults to $facts['os_service_default'].
 | 
			
		||||
#
 | 
			
		||||
#  [*log_facility*]
 | 
			
		||||
#    (optional) Log level
 | 
			
		||||
#    Defaults to 'LOG_LOCAL2'.
 | 
			
		||||
#
 | 
			
		||||
#  [*purge_config*]
 | 
			
		||||
#    (optional) Whether to set only the specified config options
 | 
			
		||||
#    in the proxy config.
 | 
			
		||||
@@ -109,6 +121,9 @@ class swift::containerreconciler(
 | 
			
		||||
  $cache_tls_cafile                        = $facts['os_service_default'],
 | 
			
		||||
  $cache_tls_certfile                      = $facts['os_service_default'],
 | 
			
		||||
  $cache_tls_keyfile                       = $facts['os_service_default'],
 | 
			
		||||
  $log_name                                = $facts['os_service_default'],
 | 
			
		||||
  $log_level                               = 'INFO',
 | 
			
		||||
  $log_facility                            = 'LOG_LOCAL2',
 | 
			
		||||
  Boolean $purge_config                    = false,
 | 
			
		||||
) inherits swift::params {
 | 
			
		||||
 | 
			
		||||
@@ -156,6 +171,9 @@ class swift::containerreconciler(
 | 
			
		||||
    '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;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if $manage_service {
 | 
			
		||||
 
 | 
			
		||||
@@ -93,6 +93,10 @@
 | 
			
		||||
#   is ignored.
 | 
			
		||||
#   Defaults to $facts['os_service_default'].
 | 
			
		||||
#
 | 
			
		||||
#  [*log_name*]
 | 
			
		||||
#    (optional) Log name.
 | 
			
		||||
#    Defaults to $facts['os_service_default'].
 | 
			
		||||
#
 | 
			
		||||
#  [*log_level*]
 | 
			
		||||
#    (optional) Log level.
 | 
			
		||||
#    Defaults to 'INFO'.
 | 
			
		||||
@@ -125,6 +129,7 @@ class swift::objectexpirer(
 | 
			
		||||
  $cache_tls_cafile              = $facts['os_service_default'],
 | 
			
		||||
  $cache_tls_certfile            = $facts['os_service_default'],
 | 
			
		||||
  $cache_tls_keyfile             = $facts['os_service_default'],
 | 
			
		||||
  $log_name                      = $facts['os_service_default'],
 | 
			
		||||
  $log_level                     = 'INFO',
 | 
			
		||||
  $log_facility                  = 'LOG_LOCAL2',
 | 
			
		||||
  Boolean $purge_config          = false,
 | 
			
		||||
@@ -190,6 +195,7 @@ class swift::objectexpirer(
 | 
			
		||||
    'object-expirer/reclaim_age':                   value => $reclaim_age;
 | 
			
		||||
    'object-expirer/recon_cache_path':              value => $recon_cache_path;
 | 
			
		||||
    'object-expirer/report_interval':               value => $report_interval;
 | 
			
		||||
    'object-expirer/log_name':                      value => $log_name;
 | 
			
		||||
    'object-expirer/log_facility':                  value => $log_facility;
 | 
			
		||||
    'object-expirer/log_level':                     value => $log_level;
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										17
									
								
								releasenotes/notes/more-log-opts-a6cfc6204a7e5d8a.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								releasenotes/notes/more-log-opts-a6cfc6204a7e5d8a.yaml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,17 @@
 | 
			
		||||
---
 | 
			
		||||
features:
 | 
			
		||||
  - |
 | 
			
		||||
    The new ``swift::objectexpirer::log_name`` option has been added.
 | 
			
		||||
 | 
			
		||||
  - |
 | 
			
		||||
    The following options have been added to the ``swift::containerreconciler``
 | 
			
		||||
    class.
 | 
			
		||||
 | 
			
		||||
    - ``log_name``
 | 
			
		||||
    - ``log_level``
 | 
			
		||||
    - ``log_facility``
 | 
			
		||||
 | 
			
		||||
fixes:
 | 
			
		||||
  - |
 | 
			
		||||
    container-reconciler is now configured to use the local2 facility by
 | 
			
		||||
    default.
 | 
			
		||||
@@ -27,6 +27,12 @@ describe 'swift::containerreconciler' do
 | 
			
		||||
          'container-reconciler/reclaim_age').with_value('<SERVICE DEFAULT>')
 | 
			
		||||
        is_expected.to contain_swift_container_reconciler_config(
 | 
			
		||||
          'container-reconciler/request_tries').with_value('<SERVICE DEFAULT>')
 | 
			
		||||
        is_expected.to contain_swift_container_reconciler_config(
 | 
			
		||||
          'container-reconciler/log_name').with_value('<SERVICE DEFAULT>')
 | 
			
		||||
        is_expected.to contain_swift_container_reconciler_config(
 | 
			
		||||
          'container-reconciler/log_level').with_value('INFO')
 | 
			
		||||
        is_expected.to contain_swift_container_reconciler_config(
 | 
			
		||||
          'container-reconciler/log_facility').with_value('LOG_LOCAL2')
 | 
			
		||||
        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(
 | 
			
		||||
 
 | 
			
		||||
@@ -31,6 +31,8 @@ describe 'swift::objectexpirer' do
 | 
			
		||||
          'object-expirer/recon_cache_path').with_value('<SERVICE DEFAULT>')
 | 
			
		||||
        is_expected.to contain_swift_object_expirer_config(
 | 
			
		||||
          'object-expirer/report_interval').with_value('<SERVICE DEFAULT>')
 | 
			
		||||
        is_expected.to contain_swift_object_expirer_config(
 | 
			
		||||
          'object-expirer/log_name').with_value('<SERVICE DEFAULT>')
 | 
			
		||||
        is_expected.to contain_swift_object_expirer_config(
 | 
			
		||||
          'object-expirer/log_level').with_value('INFO')
 | 
			
		||||
        is_expected.to contain_swift_object_expirer_config(
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user