Closed martha-garasky closed 1 month ago
Will consider it for a future sprint.
I'd like to upvote this. Wherever the x-request-id or correlation-id are available, they should be logged. In addition to the rationale provided by @martha-garasky, our EHR has multiple practices and this would allow us to track volume and load with better granularity since we bake the practice id into the x-request-id.
I'd also like to add a request that logging be more complete for other use cases even when x-request-id isn't in scope. E.g.,
Connecting to IMAP Inbox
- should indicate which direct address is being logged in with.task_instance
id. E.g., "Error in completing the Execution, retry in 5 minutes
ARN c.d.cda.utils.ValidateErrorHandler LINE[35] - Message: Error validating XML Data at Line: 3211 Column: 64 Message: cvc-pattern-valid: Value....
We have added xRequestId to start / end of the task execution, so all messages from the thread within that context is for the same request id. Currently it is not possible to change each log statement to add xRequestId.
In order better follow the lifecycle of a triggered message, can we add the requestId from the trigger event into all logged events. Making this a configurable option also is ok.
So a log would go from looking like this:
2023-04-09 21:44:27.740 ERROR 1 --- [pool-1-thread-2] c.d.b.e.s.i.EhrFhirR4QueryServiceImpl : No entries found for type : MedicationRequest
to something like this:
2023-04-09 21:44:27.740 ERROR 1 --- [pool-1-thread-2] c.d.b.e.s.i.EhrFhirR4QueryServiceImpl : RequestId: <id> -- No entries found for type : MedicationRequest
This additional item in the log message will help making parsing easier when using external logging tools such as splunk.