There are many ways to log info with camel
- .log -dsl
- .to("log: ")
- .wireTap("direct:myLogRoute")
- .process(customLogProcessor)
All this can be mixed of course. On the other hand i have some requirements about logging:
- log into an elastic search instance (http/rest, no problem to integrated with camel)
- log the "MessageHistory" and some selected bodies and headers (at least incoming and outgoing and some intermediate)
- minimize "pollution" of routes with statements like (log, wiretap etc)
- minimize write access to elastic search or the cache in between -> one, probably big entry per exchanged handled
So what would be a good way to achieve all this (don't know if all are good ideas)?
Ideas that came to my mind:
- override DefaultMessageHistory and enrich it with payload/header data for some selected nodes (or all nodes) - how to override DefaultMassageHistory?
- define an interceptor that intercepts selected nodes and collects information (as separate property?) to be "logged" at the end
I don't want to reinvent the wheel. I hope there is a pattern or a set of pattern to be used here. Thanks in advance