Thom
Thom

Reputation: 15092

Log JSON message in Camel Route

I tried googling this and found nothing.

I know that you can use expression language like ${file:name} to log the file name, but how do you log the contents. How do you log the contents of the json message being passed forward?

Upvotes: 1

Views: 2035

Answers (2)

Souciance Eqdam Rashti
Souciance Eqdam Rashti

Reputation: 3191

You can log the body and headers of the exchange by writing

.log(LoggingLevel.INFO, "test", "${body} and ${headers}")

Upvotes: 4

Alexandre Cartapanis
Alexandre Cartapanis

Reputation: 1523

Depending on how you log, but you can use a TraceFormatter with showBody set to true, read http://camel.apache.org/tracer.html

Upvotes: 0

Related Questions