我需要能够在standalone.xml日志配置中使用多个substituteAll过滤器表达式,如下所示。
<periodic-rotating-file-handler name="FILE" autoflush="true">
<filter-spec value="substituteAll("(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11})","xxxx-xxxx-xxxx-xx"),substituteAll("(<ccSecurityCode>.*</ccSecurityCode>)","<ccSecurityCode>xxx</ccSecurityCode>")"/>
<formatter>
<pattern-formatter pattern="%d{yyyy-MM-dd HH:mm:ss} - %5p:%X{sessionId} - %C{1}.%M:(%L) | %m%n"/>
</formatter>
<file relative-to="jboss.server.log.dir" path="website.log"/>
<suffix value=".yyyy-MM-dd"/>
<append value="true"/>
</periodic-rotating-file-handler>
我们正在使用JBoss AS 7.2。有没有办法做到这一点?我所有尝试这样做的尝试都失败了。我尝试用逗号分隔它们(抛出IllegalArgumentException“过滤器表达式后的额外数据”),将它们添加到任何/所有;但没有任何作用。
答案 0 :(得分:0)
您需要将其包装在all()
过滤器中。由于substituteAll
过滤器始终返回true
而all()
过滤器确保所有过滤器都返回应该有效的可记录值。