)]}'
{"watcher/decision_engine/model/notification/nova.py":[{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"e8c868d0735061535fe3e4fdc515d2db7c0bc1d7","unresolved":false,"context_lines":[{"line_number":26,"context_line":"from watcher.decision_engine.model.notification import filtering"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"def _add_detailed_logging_adapter(**kwargs):"},{"line_number":32,"context_line":"    \"\"\"Add log adapter to capture additional needed log details.\"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"5a3905b3_6548e12e","line":29,"updated":"2017-01-19 08:39:56.000000000","message":"Quick heads up: found out this example http://docs.openstack.org/developer/oslo.log/examples.html#usage-context-py and was wondering whether it could do the trick. So I just tried it in an ipython REPL and it seems to actually work wonders! Below is what I tried:\n\nfrom oslo_config import cfg\nfrom oslo_context import context\nfrom oslo_log import log as logging\n\nCONF \u003d cfg.CONF\nDOMAIN \u003d \u0027demo\u0027\nLOG \u003d logging.getLogger(\"LOGGER_NAME\", \u0027ID\u0027)\n\nlogging.register_options(CONF)\nlogging.setup(CONF, DOMAIN)\n\nctx \u003d context.RequestContext(request_id\u003d\u0027MESSAGE-ID\u0027, user\u003d\u0027ME\u0027, tenant\u003d\u0027TENANT\u0027, domain\u003d\u0027DOMAIN\u0027)\n\nLOG.info(\"With context\")\n\n\u003e\u003e\u003e 2017-01-19 09:34:35.796 25157 INFO LOGGER_NAME [MESSAGE-ID ME TENANT DOMAIN - -] With context\n\n\n\n---------------------\n\nSo if we follow this logic, we could simply declare a sensible request context somewhere and that would automagically add the message-id in all the subsequent LOG calls. So IMHO it\u0027s worth a try!","commit_id":"4e92c5d4099bb0dfb7481e3af38d09089cc39b6e"},{"author":{"_account_id":22775,"name":"Prudhvi Rao Shedimbi","email":"prudhvi.rao.shedimbi@intel.com","username":"pshedimb"},"change_message_id":"75feb55ede6b9ca4591a4c966ef452c165406526","unresolved":false,"context_lines":[{"line_number":16,"context_line":"# See the License for the specific language governing permissions and"},{"line_number":17,"context_line":"# limitations under the License."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"from oslo_context import context"},{"line_number":20,"context_line":"from oslo_log import log"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"from watcher._i18n import _LI, _LW"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a461143_525bfbf5","line":19,"range":{"start_line":19,"start_character":25,"end_line":19,"end_character":32},"updated":"2017-01-30 21:37:51.000000000","message":"There is also a watcher.common.context. Shouldn\u0027t you import that here?","commit_id":"9c7c1d264b126e3038fbda359b0eaa8fe2487ba7"},{"author":{"_account_id":18971,"name":"Vincent Françoise","email":"Vincent.FRANCOISE@b-com.com","username":"v-francoise"},"change_message_id":"b05be0d8e73c12602b160a956547db58b7a54c7f","unresolved":false,"context_lines":[{"line_number":220,"context_line":"            event_type\u003d\u0027service.update\u0027,"},{"line_number":221,"context_line":"        )"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"    def info(self, ctxt, publisher_id, event_type, payload, metadata):"},{"line_number":224,"context_line":"        context.RequestContext(request_id\u003dpublisher_id,"},{"line_number":225,"context_line":"                               project_domain\u003devent_type)"},{"line_number":226,"context_line":"        LOG.info(_LI(\"Event \u0027%(event)s\u0027 received from %(publisher)s \""}],"source_content_type":"text/x-python","patch_set":3,"id":"3a461143_b22e98f8","line":223,"range":{"start_line":223,"start_character":19,"end_line":223,"end_character":23},"updated":"2017-02-01 13:39:12.000000000","message":"maybe you just need to change request_id and project_domain from ctxt to make it work instead of instantiating a new object","commit_id":"26a4726fc117d822cfb459fdc52a17e9fead2569"}]}
