3 Replies Latest reply on Mar 29, 2013 12:41 AM by Piyush Jain

    configuring filters for console-handler in Jboss AS 7

    yanivl lugassy Newbie

      Hi

      i finally managed to migrate my application from Jboss 4 to  Jboss 7

      i manged to overcome all the major issues and left with a small annoying issue.

      we used to have a filter in the log4J Console appender

       

      Jboss 4 configuration

       

      <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">

           ....

             <filter class="org.apache.log4j.varia.StringMatchFilter">

                        <param name="StringToMatch" value="some string" />

                        <param name="AcceptOnMatch" value="false" />

                </filter>

         </appender>

       

      when i try to add a filter element to Jboss 7 standalone.xml console-handler in the logging part:

       

       

      <console-handler name="CONSOLE">

                 

                      <level name="INFO"/>

                     <filter>

                               ....

                     </filter>

                      <formatter>

                          <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>

                      </formatter>

                     

                  </console-handler>

       

       

      i fail with the  error bellow - when checking the logging:1.1.xsd it looks like i should be able to add a filter element

      does any one have an explanation ?

       

       

       

      Error:

       

      15:31:09,801 ERROR [stderr] Exception in thread "Controller Boot Thread" java.lang.RuntimeException: org.jboss.as.controller.persistence.ConfigurationPersistenceException: Failed to parse configuration

      15:31:09,801 ERROR [stderr]     at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:89)

      15:31:09,801 ERROR [stderr]     at java.lang.Thread.run(Thread.java:619)

      15:31:09,801 ERROR [stderr] Caused by: org.jboss.as.controller.persistence.ConfigurationPersistenceException: Failed to parse configuration

      15:31:09,801 ERROR [stderr]     at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:115)

      15:31:09,801 ERROR [stderr]     at org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.java:104)

      15:31:09,801 ERROR [stderr]     at org.jboss.as.server.ServerService.boot(ServerService.java:195)

      15:31:09,801 ERROR [stderr]     at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:83)

      15:31:09,801 ERROR [stderr]     ... 1 more

      15:31:09,801 ERROR [stderr] Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[65,16]

      15:31:09,801 ERROR [stderr] Message: Unexpected element '{urn:jboss:domain:logging:1.1}filter' encountered

      15:31:09,801 ERROR [stderr]     at org.jboss.as.controller.parsing.ParseUtils.unexpectedElement(ParseUtils.java:65)

      15:31:09,801 ERROR [stderr]     at org.jboss.as.logging.LoggingSubsystemParser.parseConsoleHandlerElement(LoggingSubsystemParser.java:433)

      15:31:09,801 ERROR [stderr]     at org.jboss.as.logging.LoggingSubsystemParser.readElement(LoggingSubsystemParser.java:140)

      15:31:09,833 ERROR [stderr]     at org.jboss.as.logging.LoggingSubsystemParser.readElement(LoggingSubsystemParser.java:88)

      15:31:09,833 ERROR [stderr]     at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:100)

      15:31:09,833 ERROR [stderr]     at org.jboss.staxmapper.XMLExtendedStreamReaderImpl.handleAny(XMLExtendedStreamReaderImpl.java:69)

      15:31:09,833 ERROR [stderr]     at org.jboss.as.controller.parsing.StandaloneXml.parseServerProfile(StandaloneXml.java:311)

      15:31:09,833 ERROR [stderr]     at org.jboss.as.controller.parsing.StandaloneXml.readServerElement(StandaloneXml.java:163)

      15:31:09,833 ERROR [stderr]     at org.jboss.as.controller.parsing.StandaloneXml.readElement(StandaloneXml.java:91)

      15:31:09,833 ERROR [stderr]     at org.jboss.as.controller.parsing.StandaloneXml.readElement(StandaloneXml.java:79)

      15:31:09,833 ERROR [stderr]     at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:100)

      15:31:09,833 ERROR [stderr]     at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:59)

      15:31:09,833 ERROR [stderr]     at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:107)

      15:31:09,833 ERROR [stderr]     ... 4 more