Throughout my flows I have the "logger" component that writes important messages to the log. Mule itself is also outputting "INFO" and "ERROR" logging information that is important for another part of my application. Now, I would like to send all the log messages away to another application when the flow execution is finished. I am thinking the right way to do this is to create an interceptor, add the messages to a list set as a flow variable, and send it away at the end of the flow execution. But I would also like the logger.debug(), logger.info(), that I have in my custom component Java code to also be added to the list and sent away.
Would using an interceptor be the right way to do this?