Browse code

neutron should log user_name and project_name by default like in nova

neutron doesn't log user_name and project_name along side req-id in
devstack logs. So, Openstack jenkins neutron check and gate jobs also
not logging user_name and project_name along side req-id.
Without knowing the user and tenant, its hard to understand what the
logs are doing when multiple tenants are using the cloud.

Nova is logging user_name and project_name by default.
So porting the same changes to neutron.

Change-Id: I10eac2e4177a898e9bcc60c08f3bd39a2ec9f31b
Closes-Bug: #1399788

venkata anil authored on 2015/01/15 16:38:22
Showing 1 changed files
... ...
@@ -837,6 +837,9 @@ function _configure_neutron_common {
837 837
     # Format logging
838 838
     if [ "$LOG_COLOR" == "True" ] && [ "$SYSLOG" == "False" ]; then
839 839
         setup_colorized_logging $NEUTRON_CONF DEFAULT project_id
840
+    else
841
+        # Show user_name and project_name by default like in nova
842
+        iniset $NEUTRON_CONF DEFAULT logging_context_format_string "%(asctime)s.%(msecs)03d %(levelname)s %(name)s [%(request_id)s %(user_name)s %(project_name)s] %(instance)s%(message)s"
840 843
     fi
841 844
 
842 845
     if is_service_enabled tls-proxy; then