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
This commit is contained in:
Sean Dague 2017-05-03 09:58:21 -04:00
parent 8b8441f3be
commit b2bfe5617a

View File

@ -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"
}