Mule JSON验证模式组件避免错误日志

Mule JSON验证模式组件避免错误日志,json,mule,Json,Mule,我正在使用JSON验证模式组件,我注意到,它将所有错误记录到控制台 我希望避免在控制台中显示此错误消息 尽管我选择了一个特殊的异常策略,该策略包含带有JSONValidation exception的catch exception策略,并实现了自定义逻辑,其中根本没有记录器,但我仍然看到以下错误消息: org.mule.api.MessagingException: Json content is not compliant with schema com.github.fge.jsonsche

我正在使用JSON验证模式组件,我注意到,它将所有错误记录到控制台

我希望避免在控制台中显示此错误消息

尽管我选择了一个特殊的异常策略,该策略包含带有JSONValidation exception的catch exception策略,并实现了自定义逻辑,其中根本没有记录器,但我仍然看到以下错误消息:

org.mule.api.MessagingException: Json content is not compliant with schema
com.github.fge.jsonschema.core.report.ListProcessingReport: failure
--- BEGIN MESSAGES ---
error: string "blah" is too long (length: 4, maximum allowed: 3)
    level: "error"
    schema: {"loadingURI":"file:/...}
    instance: {"pointer":"/blah_blah_code"}
    domain: "validation"
    keyword: "maxLength"
    value: "blah"
    found: 4
    maxLength: 3
---  END MESSAGES  ---

我如何让mule忽略此错误消息?我不希望将这些错误记录到控制台。

您可以将元素的logException属性设置为false,强制mule不将错误记录到控制台:

<catch-exception-strategy logException="false">

您可以将元素的logException属性设置为false,强制mule不将错误记录到控制台:

<catch-exception-strategy logException="false">

在log4j2.xml中将下面的记录器设置为false

<AsyncLogger name="org.mule.module.apikit.validation.RestJsonSchemaValidator" level="OFF"/>

在log4j2.xml中将下面的记录器设置为false

<AsyncLogger name="org.mule.module.apikit.validation.RestJsonSchemaValidator" level="OFF"/>


这不是记录异常。。。但是,每当抛出验证异常时,人们都会收到通知(Anypoint警报通知),表明此应用程序在某个时间段失败。有没有办法避免mule为JSON验证组件抛出异常?如果验证确实失败,则无法避免异常,但就像可以隐藏日志一样,可以通过在异常策略中设置
enableNotifications=false
来避免错误通知。我建议使用choice异常策略,以便仅将这些规则应用于验证器异常。这不是记录异常。。。但是,每当抛出验证异常时,人们都会收到通知(Anypoint警报通知),表明此应用程序在某个时间段失败。有没有办法避免mule为JSON验证组件抛出异常?如果验证确实失败,则无法避免异常,但就像可以隐藏日志一样,可以通过在异常策略中设置
enableNotifications=false
来避免错误通知。我建议使用choice异常策略,以便仅将这些规则应用于验证器异常。嗯