Files
8ae52af64af2e488ae6f96c32b1078c3889fb20d
puppet-oslo /manifests /log.pp

165 lines
7.0 KiB
ObjectPascal
Raw Normal View History

#
#Configureoslo_logoptions
#
#ThisresourceconfiguresOslologgingresourcesforanOpenStackservice.
#Itwillmanagethe[DEFAULT]sectioninthegivenconfigresource.
#
#===Parameters:
#
#(Optional)Shouldthedaemonslogdebugmessages
#Defaultsto$::os_service_default
#
#[*verbose*]
#(Optional)Shouldthedaemonslogverbosemessages
#Defaultsto$::os_service_default
#
#[*log_config_append*]
#Thenameofanadditionalloggingconfigurationfile.
#Defaultsto$::os_service_default
#Seehttps://docs.python.org/2/howto/logging.html
#
#[*log_date_format*]
#(Optional)Formatstringfor%%(asctime)sinlogrecords.
#Defaultsto$::os_service_default
#Example:'Y-%m-%d %H:%M:%S'
#
#[*log_file*]
#(Optional)Nameoflogfiletooutputto.Ifnodefaultisset,loggingwillgotostdout.
#Thisoptionisignorediflog_config_appendisset.
#Defaultsto$::os_service_default
#
#[*log_dir*]
#(Optional)Directorywherelogsshouldbestored.
#Ifsettobooleanfalse,itwillnotlogtoanydirectory.
#Defaultsto$::os_service_default
#
#[*watch_log_file*]
#(Optional)Useslogginghandlerdesignedtowatchfilesystem(booleanvalue).
#Defaultsto$::os_service_default
#
#[*use_syslog*]
#(Optional)Usesyslogforlogging(booleanvalue).
#Defaultsto$::os_service_default
#
#[*syslog_log_facility*]
#(Optional)Syslogfacilitytoreceiveloglines.
#Thisoptionisignorediflog_config_appendisset.
#Defaultsto$::os_service_default
#
#Thisoptionisignorediflog_config_appendisset.
#Defaultsto$::os_service_default
#[*logging_context_format_string*]
#(Optional)Formatstringtouseforlogmessageswithcontext.
#Example:'%(asctime)s.%(msecs)03d%(process)d%(levelname)s%(name)s\
#[%(request_id)s%(user_identity)s]%(instance)s%(message)s'
#[*logging_default_format_string*]
#(Optional)Formatstringtouseforlogmessageswhencontextisundefined.
#Example:'%(asctime)s.%(msecs)03d%(process)d%(levelname)s\
#%(name)s[-]%(instance)s%(message)s'
#[*logging_debug_format_suffix*]
#(Optional)AdditionaldatatoappendtologmessagewhenlogginglevelforthemessageisDEBUG'
#Example:'%(funcName)s %(pathname)s:%(lineno)d'
#[*logging_exception_prefix*]
#(Optional)Prefixeachlineofexceptionoutputwiththisformat.
#Example:'%(asctime)s.%(msecs)03d %(process)d ERROR %(name)s %(instance)s'
#[*logging_user_identity_format*]
#(Optional)Definestheformatstringfor%(user_identity)sthatisusedinlogging_context_format_string.
#Example:'%(user)s %(tenant)s %(domain)s %(user_domain)s %(project_domain)s'
#[*default_log_levels*]
#Defaultsto$::os_service_default
#Example:
#{'amqp'=>'WARN','amqplib'=>'WARN','boto'=>'WARN',
#'qpid'=>'WARN','sqlalchemy'=>'WARN','suds'=>'INFO',
#'iso8601'=>'WARN',
#'requests.packages.urllib3.connectionpool'=>'WARN'}
#[*publish_errors*]
#[*instance_format*]
#(Optional)Theformatforaninstancethatispassedwiththelogmessage.
#Example:'[instance: %(uuid)s] '
#[*instance_uuid_format*]
#(Optional)TheformatforaninstanceUUIDthatispassedwiththelogmessage.
#Example:'[instance: %(uuid)s] '
#
#[*fatal_deprecations*]
#(Optional)Enablesordisablesfatalstatusofdeprecations(booleanvalue).
defineoslo::log(
$verbose=$::os_service_default,
$log_config_append=$::os_service_default,
$log_date_format=$::os_service_default,
$log_file=$::os_service_default,
$log_dir=$::os_service_default,
$watch_log_file=$::os_service_default,
$use_syslog=$::os_service_default,
$syslog_log_facility=$::os_service_default,
$logging_context_format_string=$::os_service_default,
$logging_default_format_string=$::os_service_default,
$logging_debug_format_suffix=$::os_service_default,
$logging_exception_prefix=$::os_service_default,
$logging_user_identity_format=$::os_service_default,
$default_log_levels=$::os_service_default,
$publish_errors=$::os_service_default,
$instance_format=$::os_service_default,
$instance_uuid_format=$::os_service_default,
ifis_service_default($default_log_levels){
$default_log_levels_real=$default_log_levels
}else{
validate_hash($default_log_levels)
$default_log_levels_real=join(sort(join_keys_to_values($default_log_levels,'=')),',')
}
'DEFAULT/debug'=>{ value => $debug },
'DEFAULT/verbose'=>{ value => $verbose },
'DEFAULT/log_config_append'=>{ value => $log_config_append },
'DEFAULT/log_date_format'=>{ value => $log_date_format },
'DEFAULT/log_file'=>{ value => $log_file },
'DEFAULT/log_dir'=>{ value => $log_dir },
'DEFAULT/watch_log_file'=>{ value => $watch_log_file },
'DEFAULT/use_syslog'=>{ value => $use_syslog },
'DEFAULT/syslog_log_facility'=>{ value => $syslog_log_facility },
'DEFAULT/use_stderr'=>{ value => $use_stderr },
'DEFAULT/logging_context_format_string'=>{ value => $logging_context_format_string },
'DEFAULT/logging_default_format_string'=>{ value => $logging_default_format_string },
'DEFAULT/logging_debug_format_suffix'=>{ value => $logging_debug_format_suffix },
'DEFAULT/logging_exception_prefix'=>{ value => $logging_exception_prefix },
'DEFAULT/logging_user_identity_format'=>{ value => $logging_user_identity_format },
'DEFAULT/default_log_levels'=>{ value => $default_log_levels_real },
'DEFAULT/publish_errors'=>{ value => $publish_errors },
'DEFAULT/instance_format'=>{ value => $instance_format },
'DEFAULT/instance_uuid_format'=>{ value => $instance_uuid_format },
'DEFAULT/fatal_deprecations'=>{ value => $fatal_deprecations },
}
create_resources($name,$log_options)