2 Replies Latest reply on Nov 5, 2013 3:39 AM by johannes.reuter

    Disable verbose exception logging

    johannes.reuter

      If a user tries to log in in my application without valid credentials, a LoginException (security-subsystem), an EJBAccessException (invocation failed) and an EJBException (answer to the client) get thrown and logged.

       

      Is there a way to supress / ignore these exceptions in the log-files?

       

      My basic approaches were:

      • Filter them by <filter><match pattern="..", but the regex only matches to the message, not stacktrace/cause, ...
      • Use log4j as logging-backend, where you apply custom filter-classes, but I wasn't able to replace the logging-subsystem
      • Implement a custom handler, but it's a lot of effort and I loose all the nice features like periodic-rotating-file-handler etc.
      • Use a different handler for my own loggers (via <logger category="...) and log the error myself (once)

       

      Greetings and thanks in advance

        • 1. Re: Disable verbose exception logging
          jamezp

          There really isn't a good way to do it unfortunately. A custom-handler would probably be your best bet. You could just extend the org.jboss.logmanager.handlers.PeriodicRotatingFileHandler to get the same benefits. You would just override the doPublish(ExtLogRecord) and check the ExtLogRecord.getThrown() to determine if it's loggable or not.

           

          I did file an issue to create a filter for exceptions, but I haven't really thought it all the way through yet.

          --

          James R. Perkins

          • 2. Re: Disable verbose exception logging
            johannes.reuter

            OK, thank you for your quick response.

            I will use 2 log-files for now, I think it's the easiest way to do this.