我尝试为类型为DeadLetterChannel的errorHandler指定记录器名称,并且出现有关无法为此使用logName的错误。
是否可以指定记录器名称?
还是不好的做法,将自己的记录器名称用于dlc?
我的配置
<errorHandler id="myDeadLetterChannel" type="DeadLetterChannel" deadLetterUri="direct:deadLetterChannel" logName="MYLOGGERNAME">
<redeliveryPolicy maximumRedeliveries="5" retryAttemptedLogLevel="INFO" backOffMultiplier="2" useExponentialBackOff="true" />
</errorHandler>
实际日志消息:
13:31:46,947 | INFO | evMasterDbEvent] | DeadLetterChannel 176 | 144 - org.apache.camel.camel-core - 2.12.0.redhat-610379 | Failed delivery for (MessageId: ID:tetra-backend-43331-1577539405267-13:6:2:1:1 on ExchangeId: ID-tetra-backend-38269-1577539416633-5-5). On delivery attempt: 0 caught: com.x.exception.BusinessLogicException: Unexpected event type ZZZ
预期的日志消息:
13:31:46,947 | INFO | evMasterDbEvent] | MYLOGGERNAME 176 | 144 - org.apache.camel.camel-core - 2.12.0.redhat-610379 | Failed delivery for (MessageId: ID:tetra-backend-43331-1577539405267-13:6:2:1:1 on ExchangeId: ID-tetra-backend-38269-1577539416633-5-5). On delivery attempt: 0 caught: com.x.exception.BusinessLogicException: Unexpected event type ZZZ
我还尝试添加CamelLogEipName,这样我就不会更改记录器名称...
<camelContext xmlns="http://camel.apache.org/schema/spring">
<properties>
<property key="CamelLogEipName" value="MYLOGGERNAME"/>
</properties>