我想控制执行骆驼路线时发生异常(400,org.apache.camel.component.http.HttpOperationFailedException)时要记录的内容。
以下路由将所有内容(包括stacktrace)记录到日志文件中。我想限制特定路由的堆栈跟踪记录。 关于如何工作的任何想法?
<route id="restCall">
<from uri="direct:restCall" />
<doTry>
<setHeader headerName="Connection">
<constant>close</constant>
</setHeader>
<setHeader headerName="CamelHttpMethod">
<constant>GET</constant>
</setHeader>
<to uri="log:org.apache.camel.component.http?level=ERROR&showException=true&showStackTrace=false&showHeaders=true&showBody=true" />
<recipientList>
<header>PreparedUrl</header>
</recipientList>
<doCatch>
<exception>org.apache.camel.component.http.HttpOperationFailedException
</exception>
<handled>
<constant>true</constant>
</handled>
</doCatch>
</doTry>
</route>