Browse code

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

Sean Dague authored on 2017/05/03 22:58:21
Showing 1 changed files
... ...
@@ -606,13 +606,25 @@ function setup_colorized_logging {
606 606
 function setup_systemd_logging {
607 607
     local conf_file=$1
608 608
     local conf_section="DEFAULT"
609
-    iniset $conf_file $conf_section use_journal "True"
609
+    # NOTE(sdague): this is a nice to have, and means we're using the
610
+    # native systemd path, which provides for things like search on
611
+    # request-id. However, there may be an eventlet interaction here,
612
+    # so going off for now.
613
+    USE_JOURNAL=$(trueorfalse USE_JOURNAL False)
614
+    if [[ "$USE_JOURNAL" == "True" ]]; then
615
+        iniset $conf_file $conf_section use_journal "True"
616
+        # if we are using the journal directly, our process id is already correct
617
+        iniset $conf_file $conf_section logging_debug_format_suffix \
618
+               "{{%(funcName)s %(pathname)s:%(lineno)d}}"
619
+    else
620
+        iniset $conf_file $conf_section logging_debug_format_suffix \
621
+               "{{(pid=%(process)d) %(funcName)s %(pathname)s:%(lineno)d}}"
622
+    fi
623
+
610 624
     iniset $conf_file $conf_section logging_context_format_string \
611 625
            "%(levelname)s %(name)s [%(request_id)s %(project_name)s %(user_name)s] %(instance)s%(message)s"
612 626
     iniset $conf_file $conf_section logging_default_format_string \
613 627
            "%(levelname)s %(name)s [-] %(instance)s%(color)s%(message)s"
614
-    iniset $conf_file $conf_section logging_debug_format_suffix \
615
-           "from (pid=%(process)d) %(funcName)s %(pathname)s:%(lineno)d"
616 628
     iniset $conf_file $conf_section logging_exception_prefix "ERROR %(name)s %(instance)s"
617 629
 }
618 630