Currently configuring a custom ExchangeFormatter at the Log Component level may lead to incoherent results if there are multiple Log endpoints in the context, with different log options (e.g. showBody=true, showBody=false).
This is because the component looks up the ExchangeFormatter in the registry, sets its properties and then remembers the result for the subsequent endpoint initialisations. This is incorrect.
The correct procedure is:
- Look up the ExchangeFormatter each time, obtaining a new fresh copy each time. This can be ensured by using @scope=prototype in Spring/Blueprint in the bean definition.
- Set its properties, according to the current endpoint's properties.
- Use the resulting ExchangeFormatter for that endpoint only.
- Subsequent endpoint initialisations must repeat the same procedure.