Search code examples
loggingmulecxfesbmule-flow

Mule logging: Interceptors or Logger component?


I am trying to implement logging in mule and have a basic question.

My services are all configured to run on a tomcat server and not on Mule. I am only using Mule for orchestration.

Should I use interceptors or a logger component? As far as I can see, Interceptors are being used with CXF service and simple service definitions. But my services are not in Mule.

I am using Proxy service and client to call the external services.

Questions:

  1. As far as I understand, using CXF Interceptors for logging is useful when testing, but is it the proper way to log messages in Mule?

  2. Is it ok to have interceptors with Proxy service and client?


Solution

  • I would prefer using <logger /> instead of <logging-interceptor /> because logger has plenty of configurable options that allow you to log exactly what you want (message expression), where you want (category) and at the level you want (INFO, ...).