I need to log the value of the message header with key “foo_bar” so that the log message looks something like this when the value of that header is “baz”:
Value of header foo_bar: baz
How to do this with a wire-tap and logging-channel-adapter?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use the expression attribute of the logging-channel-adapter and set up the wire-tap and logging-channel-adapter something like this:
When using the expression attribute, the root object is the spring integration message. So “headers” in the expression gets you the headers map of the message.