Huong Dan Java Logger – Part 7 – Access Correlation Id from log message

Adding the Correlation Id to the log message will help us to identify which request is experiencing a problem in case our Mule ESB application fails.

I will use the Mapped Diagnostic Context of the Logging Framework to pass the Correlation Id’s information to the log message. You can refer to the concept of Mapped Diagnostic Context here.

To do this, we first declare a constant variable in the HuongDanJavaLoggerComponentConnector class, which acts as the key to pass the Correlation Id to the log message.

Then, in the Processor method, I would put the Correlation Id information as follows:

 

Huong Dan Java Logger – Part 7 – Access Correlation Id from log message
Đánh giá bài viết
Chia sẽ bài viết này ...Share on Facebook
Facebook
3Tweet about this on Twitter
Twitter
Share on LinkedIn
Linkedin

Add Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.