Open apuntamb opened 4 years ago
I think better practice would be using LoggerAdapter to wrap log calls that are already emitted by the system with
request_id
.
You mean something like logging.LoggerAdapter.log("Originating Request ID: %s" % request_id)
inside the report_consumer
or inside abstract, report and slice processors?
Especially it's relevant for processors: abstract, report and slice. I see that the
request_id
is available throughreport_or_slice
variable inpre_delegate
. I suppose we can wrap the logger instance with LoggerAdapter inside thepre_delegate
and then reuse that instance all the way along the class.
In here https://github.com/quipucords/yupana/blob/master/yupana/processor/report_slice_processor.py#L98 ? By reusing it all the way do you mean wrapping it like above and using it in every method call?
As a beginner in yupana, created this small PR to fix logging of
request_id
for better traceability while debugging issues. Please review and feel free to correct in case something is missing.