Moved logging to barbican-api module

Change-Id: I4ca0a1edb96e6a7c5104b844a1c68a36ae3b4ef0
This commit is contained in:
Ade Lee
2016-03-21 21:57:46 -04:00
parent 23ee15728c
commit b4b51d1ffb
2 changed files with 58 additions and 17 deletions

View File

@@ -1,9 +1,38 @@
# Class barbican::logging # Class barbican::api::logging
# #
# barbican extended logging configuration # barbican-api extended logging configuration
# #
# == parameters # == parameters
# #
# [*verbose*]
# (Optional) Should the daemons log verbose messages
# Defaults to $::os_service_default
#
# [*debug*]
# (Optional) Should the daemons log debug messages
# Defaults to $::os_service_default
#
# [*use_syslog*]
# (Optional) Use syslog for logging.
# Defaults to $::os_service_default
#
# [*use_stderr*]
# (optional) Use stderr for logging
# Defaults to $::os_service_default
#
# [*log_facility*]
# (Optional) Syslog facility to receive log lines.
# Defaults to $::os_service_default
#
# [*log_dir*]
# (optional) Directory where logs should be stored.
# If set to boolean false, it will not log to any directory.
# Defaults to '/var/log/barbican'
#
# [*log_file*]
# (optional) File where logs should be stored.
# Defaults to '/var/log/barbican/api.log'
#
# [*logging_context_format_string*] # [*logging_context_format_string*]
# (optional) Format string to use for log messages with context. # (optional) Format string to use for log messages with context.
# Defaults to $::os_service_default # Defaults to $::os_service_default
@@ -62,13 +91,20 @@
# it like this (string value). # it like this (string value).
# Defaults to $::os_service_default # Defaults to $::os_service_default
# Example: instance_uuid_format='[instance: %(uuid)s] ' # Example: instance_uuid_format='[instance: %(uuid)s] '
#
# [*log_date_format*] # [*log_date_format*]
# (optional) Format string for %%(asctime)s in log records. # (optional) Format string for %%(asctime)s in log records.
# Defaults to $::os_service_default # Defaults to $::os_service_default
# Example: 'Y-%m-%d %H:%M:%S' # Example: 'Y-%m-%d %H:%M:%S'
class barbican::logging( class barbican::api::logging(
$use_syslog = $::os_service_default,
$use_stderr = $::os_service_default,
$log_facility = $::os_service_default,
$log_dir = '/var/log/barbican',
$log_file = '/var/log/barbican/api.log',
$verbose = $::os_service_default,
$debug = $::os_service_default,
$logging_context_format_string = $::os_service_default, $logging_context_format_string = $::os_service_default,
$logging_default_format_string = $::os_service_default, $logging_default_format_string = $::os_service_default,
$logging_debug_format_suffix = $::os_service_default, $logging_debug_format_suffix = $::os_service_default,
@@ -89,17 +125,22 @@ class barbican::logging(
} }
barbican_config { barbican_config {
'DEFAULT/logging_context_format_string': value => $logging_context_format_string; 'DEFAULT/debug': value => $debug;
'DEFAULT/logging_default_format_string': value => $logging_default_format_string; 'DEFAULT/verbose': value => $verbose;
'DEFAULT/logging_debug_format_suffix': value => $logging_debug_format_suffix; 'DEFAULT/use_stderr': value => $use_stderr;
'DEFAULT/logging_exception_prefix': value => $logging_exception_prefix; 'DEFAULT/use_syslog': value => $use_syslog;
'DEFAULT/log_config_append': value => $log_config_append; 'DEFAULT/log_dir': value => $log_dir;
'DEFAULT/default_log_levels': value => $default_log_levels_real; 'DEFAULT/syslog_log_facility': value => $log_facility;
'DEFAULT/publish_errors': value => $publish_errors; 'DEFAULT/logging_context_format_string': value => $logging_context_format_string;
'DEFAULT/fatal_deprecations': value => $fatal_deprecations; 'DEFAULT/logging_default_format_string': value => $logging_default_format_string;
'DEFAULT/instance_format': value => $instance_format; 'DEFAULT/logging_debug_format_suffix': value => $logging_debug_format_suffix;
'DEFAULT/instance_uuid_format': value => $instance_uuid_format; 'DEFAULT/logging_exception_prefix': value => $logging_exception_prefix;
'DEFAULT/log_date_format': value => $log_date_format; 'DEFAULT/log_config_append': value => $log_config_append;
'DEFAULT/default_log_levels': value => $default_log_levels_real;
'DEFAULT/publish_errors': value => $publish_errors;
'DEFAULT/fatal_deprecations': value => $fatal_deprecations;
'DEFAULT/instance_format': value => $instance_format;
'DEFAULT/instance_uuid_format': value => $instance_uuid_format;
'DEFAULT/log_date_format': value => $log_date_format;
} }
} }

View File

@@ -1,6 +1,6 @@
require 'spec_helper' require 'spec_helper'
describe 'barbican::logging' do describe 'barbican::api::logging' do
let :params do let :params do
{ {