4 Replies Latest reply on May 20, 2016 2:49 PM by bounsalla

    Filter log messages resulting from a specific exception

    bounsalla

      Working with Wildfly 8.2. When shutting down the application, there are log messages being written resulting from org.jboss.as.ejb3.component.EJBComponentUnavailableException: JBAS014559: Invocation cannot proceed as component is shutting down. I'd like to prevent these messages from being logged. They are not considered important since they are a direct result of the shutdown. I've played around with filter-spec, but from what I understand that only filters based on log message. Is there any way to filter log messages that were caused by a specific exception or based on the content of the exceptions message? In log4j this could be accomplished by adding a custom filter to an appender but I don't see anything that looks similar here.

        • 1. Re: Filter log messages resulting from a specific exception
          jamezp

          Currently you'd have to filter the message itself which you could probably do with the JBAS014559 id and a not(match("JBAS014559")) filter.

           

          There is an open issue to create an exception filter though [LOGMGR-86] Create an exception filter - JBoss Issue Tracker.

           

          --

          James R. Perkins

          • 2. Re: Filter log messages resulting from a specific exception
            bounsalla

            The problem is that "JBAS014559" is not part of the actual log message. As you can see in the example below, the text of the log message is "JBAS014134:...". The log message is a result of the EJBComponentUnavailableException (that contains "JBAS014559" as it's message) . The exception and the resulting log message are a direct result of the fact that the application server is in the process of shutting down. By the time our application code receives the exception, the error message along with it's resulting stack trace has already been written to the log.

             

            14:00:39,045 ERROR [org.jboss.as.ejb3.invocation] (default-threads - 10) JBAS014134: EJB Invocation failed on component StatusUpdater for method public abstract void com.taske.collector.StatusUpdater.updateConnectedStatus(int,boolean): org.jboss.as.ejb3.component.EJBComponentUnavailableException: JBAS014559: Invocation cannot proceed as component is shutting down

              at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:59) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

              at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

              at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

              at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:55) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

              at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

              at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:326)

              at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:448)

              at org.jboss.invocation.AccessCheckingInterceptor.processInvocation(AccessCheckingInterceptor.java:61)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

              at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:326)

              at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

              at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

              at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:185)

              at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:182)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

              at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

              at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:73)

              at com.taske.ejb.session.StatusUpdaterLocal$$$view13.updateConnectedStatus(Unknown Source) [ejb-pbx-api.jar:]

              at com.taske.ra.Collector.updateStatus(Collector.java:184) [ra.rar:]

              at com.taske.ra.Collector.run(Collector.java:161) [ra.rar:]

              at org.jboss.jca.core.workmanager.WorkWrapper.run(WorkWrapper.java:219) [ironjacamar-core-impl-1.1.9.Final.jar:1.1.9.Final]

              at org.jboss.threads.SimpleDirectExecutor.execute(SimpleDirectExecutor.java:33)

              at org.jboss.threads.QueueExecutor.runTask(QueueExecutor.java:808)

              at org.jboss.threads.QueueExecutor.access$100(QueueExecutor.java:45)

              at org.jboss.threads.QueueExecutor$Worker.run(QueueExecutor.java:828)

              at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_60]

              at org.jboss.threads.JBossThread.run(JBossThread.java:122)

             

            Just to be clear, I can't filter the "JBAS014134" message because that might happen for any number of reasons. The only time it's not important is when it happens because the system is shutting down.

             

            It sounds like the proposed exception filter may be just what is needed to deal with this. Any idea when it will get implemented?

            • 3. Re: Filter log messages resulting from a specific exception
              jamezp

              Not sure. I might have a branch with it partially done. I've changed the priority to major and set a fix version. Note that the fix version doesn't mean it will be done then, but I'll plan on targeting it for the next release.

               

              --

              James R. Perkins

              • 4. Re: Filter log messages resulting from a specific exception
                bounsalla

                Excellent. Many thanks.