diff --git a/functions b/functions index c99e435175..8968a1861b 100644 --- a/functions +++ b/functions @@ -606,13 +606,25 @@ function setup_colorized_logging { function setup_systemd_logging { local conf_file=$1 local conf_section="DEFAULT" - iniset $conf_file $conf_section use_journal "True" + # NOTE(sdague): this is a nice to have, and means we're using the + # native systemd path, which provides for things like search on + # request-id. However, there may be an eventlet interaction here, + # so going off for now. + USE_JOURNAL=$(trueorfalse USE_JOURNAL False) + if [[ "$USE_JOURNAL" == "True" ]]; then + iniset $conf_file $conf_section use_journal "True" + # if we are using the journal directly, our process id is already correct + iniset $conf_file $conf_section logging_debug_format_suffix \ + "{{%(funcName)s %(pathname)s:%(lineno)d}}" + else + iniset $conf_file $conf_section logging_debug_format_suffix \ + "{{(pid=%(process)d) %(funcName)s %(pathname)s:%(lineno)d}}" + fi + iniset $conf_file $conf_section logging_context_format_string \ "%(levelname)s %(name)s [%(request_id)s %(project_name)s %(user_name)s] %(instance)s%(message)s" iniset $conf_file $conf_section logging_default_format_string \ "%(levelname)s %(name)s [-] %(instance)s%(color)s%(message)s" - iniset $conf_file $conf_section logging_debug_format_suffix \ - "from (pid=%(process)d) %(funcName)s %(pathname)s:%(lineno)d" iniset $conf_file $conf_section logging_exception_prefix "ERROR %(name)s %(instance)s" }