Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/logging/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asynchronous 使用apachecamel进行异步日志记录_Asynchronous_Logging_Apache Camel_Jbossfuse - Fatal编程技术网

Asynchronous 使用apachecamel进行异步日志记录

Asynchronous 使用apachecamel进行异步日志记录,asynchronous,logging,apache-camel,jbossfuse,Asynchronous,Logging,Apache Camel,Jbossfuse,我正试图用apachecamel实现一个异步记录器。我想在调用第三方API时记录请求和响应负载。目前,我正在使用activemq执行此操作,如下所示: .... <!-- Prepare request --> <to uri="activemq:loggingQueue??disableReplyTo=true&amp;preserveMessageQos=true"/> <recipientList> <simple>http4:a

我正试图用apachecamel
实现一个异步记录器。我想在调用第三方API时记录请求和响应负载。目前,我正在使用
activemq
执行此操作,如下所示:

....
<!-- Prepare request -->
<to uri="activemq:loggingQueue??disableReplyTo=true&amp;preserveMessageQos=true"/>
<recipientList>
  <simple>http4:api.example.com</simple>
</recipientList>
.......

<route>
  <from uri="activemq:loggingQueue"/>
  <!-- log payload -->
</route>
。。。。
http4:api.example.com
.......
  • 有没有更好的方法来实现此功能
  • 我可以将log4j2异步日志记录与camel集成吗?如果可能的话,是否有任何教程演示相同的功能?我看不到任何关于
    log4j2
    asynchronouslogging和camel的教程

实际上,camel在内部使用sl4fj,因此您可以调整logback以执行异步日志记录,以满足您的需求。这里有一些想法:

实际上,camel在内部使用sl4fj,这样您就可以调整logback来执行异步日志记录,以满足您的需求。以下是一些想法:

您可以使用
EventNotifier
钩住在消息发送到端点之前/之后具有事件的Camel。然后,您可以使用它写入日志:


还有log4j和其他日志API,通常有各种适配器以快速、异步/批处理的方式通过网络将日志写入文件。

您可以使用
EventNotifier
钩住在消息发送到端点之前/之后具有事件的Camel。然后,您可以使用它写入日志:

还有log4j和其他日志api,它们通常有各种适配器,可以通过网络以快速、异步/批处理的方式将日志写入文件