Reputation: 4490
I'm trying to implement an asynchronous logger with Apache Camel
. I want to log the request and response payload while calling a 3rd party API. Currently, I'm doing this using activemq
as follows:
....
<!-- Prepare request -->
<to uri="activemq:loggingQueue??disableReplyTo=true&preserveMessageQos=true"/>
<recipientList>
<simple>http4:api.example.com</simple>
</recipientList>
.......
<route>
<from uri="activemq:loggingQueue"/>
<!-- log payload -->
</route>
log4j2
asynchronous logging and camel together.Upvotes: 0
Views: 637
Reputation: 55555
You can use an EventNotifier
to hook into Camel that has events before/after a message is sent to an endpoint. You can then use that to write to your logs: http://camel.apache.org/eventnotifier-to-log-details-about-all-sent-exchanges.html
And also log4j and other logging apis, often have various adapters to write the logs to files / over the network in a fast and asynchronous / batch fashion.
Upvotes: 2