简体   繁体   English

在JBoss7中过滤日志记录警告?

[英]Filter logging warnings in JBoss7?

When deploying a Spring project I always get the following warning: 部署Spring项目时,我总是收到以下警告:

WARN  [org.jboss.as.ee] (MSC service thread 1-4) JBAS011006: Not installing optional component org.springframework.web.context.request.async.StandardServletAsyncWebRequest due to exception: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011054: Could not find default constructor for class org.springframework.web.context.request.async.StandardServletAsyncWebRequest

I read here on SO that this is a common warning and the way to deal with it is to filter it (it will still be there, but it will not show). 我在这里读到SO,这是一个常见的警告,处理它的方法是对其进行过滤(它仍然存在,但不会显示)。 I tried for some time but I can't seem to be able to run in correctly. 我尝试了一段时间,但似乎无法正确运行。 Here what I do in standalone-full.xml : 这是我在standalone-full.xml中所做的事情

        <root-logger>
            <level name="INFO"/>
            <filter>
                <not>
                    <match pattern="JBAS011006" />
                </not>
            </filter>

I think I tried every possible combination of filter with allow, deny, any an etc. Any help? 我想我尝试了filter与allow,deny,any等的所有可能组合。有什么帮助吗?

Not sure if the problem has been solved anywhere else on SO, but just to document it here: 不知道问题是否在SO上的其他地方得到了解决,只是在这里记录一下:

After having the same problems I resorted to the schema file jboss-as-logging_1_1.xsd . 在遇到相同的问题后,我求助于模式文件jboss-as-logging_1_1.xsd (All the XSDs can be found at http://www.jboss.org/schema/jbossas/ ). (所有XSD均可在http://www.jboss.org/schema/jbossas/中找到)。 It defines the exact places you are allowed to put those filters. 它定义了允许您放置这些过滤器的确切位置。 The only one place that worked for me was directly in the logger that throws the warning, namely org.jboss.as.ee . 唯一对我有用的地方是直接在发出警告的记录器中,即org.jboss.as.ee

So I ended up doing this: 所以我最终这样做:

<subsystem xmlns="urn:jboss:domain:logging:1.1">
    ...
    <logger category="org.jboss.as.ee">
        <filter>
            <not>
                <match pattern="JBAS011006"/>
            </not>
        </filter>
    </logger>
    ...
</subsystem>

If this still doesn't work it might be a good idea to check if any logging config files in your project cause interference. 如果仍然无法解决问题,最好检查项目中是否有任何日志配置文件引起干扰。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM