From b2bfe5617ac43a678a9113d5c955f5456c151319 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Wed, 3 May 2017 09:58:21 -0400 Subject: [PATCH] Turn off use_journal because of eventlet concerns use_journal uses the systemd native path for logging, however there are concerns that this might be negatively interacting with eventlet. To be on the safe side fall back to stdout. This introduces a USE_JOURNAL option which will let folks turn this back on for testing. This also adjusts the debug lines. When using the journal the pid reported by systemd is correct. When using stdout, it will be the parent process id, so we need to keep it to see which child each thing is coming from. Change-Id: Id7891c532bf99c099252e82d511a37a49506fea9 --- functions | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) 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" }