Why is Mule exception strategy so chatty?

前端 未结 1 376
心在旅途
心在旅途 2021-01-07 03:15

In my Mule app, I\'ve configured some of the flows to use a catch exception strategy in order to do some special processing. For these cases, I want to pop the error and the

相关标签:
1条回答
  • 2021-01-07 04:00

    The issue is that the built in exception strategies inherit from AbstractExceptionListener, and they all use the logException template method. The base implementation always logs at ERROR level, which is sometimes not appropriate for your application.

    You can create a simple subclass of CatchMessagingExceptionStrategy that overrides the logException method, and logs however you want. Then, use it in your flow in place of the <catch-exception-strategy> like so:

    <custom-exception-strategy class="com.mycompany.mule.QuietCatchExceptionStrategy">
        <!-- your message processors here -->
    </custom-exception-strategy>
    
    0 讨论(0)
提交回复
热议问题