4 Replies Latest reply on Sep 10, 2013 3:51 AM by heitziii

    JBoss AS 7 logging: exclude specific exception

    heitziii

      Hi all together,

       

      I´m new here and my first act is to ask a question, sorry for that.

       

      At the moment I am dealing with the logging of JBoss 7 AS. Is it possible to exclude a specific exception from the logging?

       

      I know it is possible to define an logger for a specific category like this:

                  <logger category="org.jboss.security.authentication.JBossCachedAuthenticationManager">
                      <level name="FATAL"/>
                  </logger>
      

       

      Now I want to exclude this exception, but I won´t  define the whole org.jboss.ejb3.invocation as logger.

      2013-09-03 16:28:22,291 ERROR [org.jboss.ejb3.invocation] - JBAS014134: EJB Invocation failed on component myClass for method public abstract void myClass.login(java.lang.String) :javax.ejb.EJBAccessException: JBAS013323: Invalid User
      at org.jboss.as.ejb3.security.SecurityContextInterceptor$1.run(SecurityContextInterceptor.java:54)
        at org.jboss.as.ejb3.security.SecurityContextInterceptor$1.run(SecurityContextInterceptor.java:45)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:74)
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
        at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59)
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)
      

       

      Is this possible?

       

      Thanks for your help.

       

      Heitziii

        • 1. Re: JBoss AS 7 logging: exclude specific exception
          ybxiang.china

          You can read the xsd documents in jboss-as-7.2.0.Final\docs\schema

          • 2. Re: JBoss AS 7 logging: exclude specific exception
            heitziii

            Hi,

             

            thanks for your advice, but i found nothing to exclude en specific exception from my logging in this files.

             

            I tried to analyse the problem more in-depth and found out that the org.jboss.as.ejb3.component.interceptors.LoggingInterceptor checks if there is an ApplicationException and when not he throws the exception.

            Do I have to tell him this is an ApplicationException and if yes, how can I do this?

             

            It would be nice if anybody can give me an hint or it would be even more nice, if anybody can give me an example for the solution of my problem ;-).

             

             

            Thanks for your help.

             

            Daniel

            • 3. Re: JBoss AS 7 logging: exclude specific exception
              ybxiang.china

              If "jboss-as-logging_1_2.xsd" does NOT support this function, I think it is impossible.

              BTW, performance issue should be considered when you try to filter specific exception.

               

              "ERROR [org.jboss.ejb3.invocation] - JBAS014134: EJB Invocation failed on component myClass for method public abstract void myClass.login(java.lang.String) :javax.ejb.EJBAccessException: JBAS013323: Invalid User "

              ~~~This is a very important log, why do you want to hide it?

               

              • 4. Re: JBoss AS 7 logging: exclude specific exception
                heitziii

                Hi,

                 

                I don´t really want to hide it, but I got the full stacktrace in my logging file and that´s bad and I have already an message about the invalid user in my logging. An simple message "error: invalid User" would be enough. But the stracktrace is thrown by the org.jboss.as.ejb3.component.interceptors.LoggingInterceptor class. So I thought I can tell this class that there is an ApplicationException, but I have no idea how I can do this.

                 

                Daniel