6 Replies Latest reply on Nov 1, 2007 3:38 PM by steven.whatmore

    Ajax4jsf pollutes log4j output

    alfons12

      Hello,

      can anybody tell me how to force ajax4jsf not to pollute my log4j output with its own debug information?

      Thank you.

        • 1. Re: Ajax4jsf pollutes log4j output
          alexsmirnov

          Your can set debug level for packages "org.ajax4jsf.*" and "org.richfaces.*" to FATAL .

          • 2. Re: Ajax4jsf pollutes log4j output

            Here is an example of our log4j properties file that does exactly what you want (some details removed)

            The various threshold levels are shown at the top and the settings to affect various parts of the ajax4jsf / richfaces component frameworks are also shown.

            The fact that these messages are turned off need to be taken into account when debugging since it will hide a lot of the details of what is going on (one of our developers already lost a few hours to this since he forgot that the messages were turned off and didn't see any exceptions when his page stopped working)

            #
            # THRESHOLDS = OFF, FATAL, ERROR, WARN, INFO, DEBUG, ALL
            #
            
            log4j.threshold=ALL
            
            log4j.logger.org.springframework=OFF
            log4j.logger.org.acegisecurity=OFF
            log4j.logger.org.ajax4jsf=OFF
            log4j.logger.org.apache.jasper.compiler=OFF
            log4j.logger.org.apache.catalina.core.ContainerBase=OFF
            log4j.logger.org.apache.catalina.session.ManagerBase=OFF
            log4j.logger.org.apache.commons.digester=OFF
            log4j.logger.org.apache.commons.beanutils=OFF
            log4j.logger.net.sf.ehcache=OFF
            log4j.logger.com.sun.facelets=OFF
            log4j.logger.com.sun.facelets.compiler.TagLibraryConfig=OFF
            log4j.logger.org.richfaces.model.ScrollableTableDataModel=OFF
            log4j.logger.org.richfaces.renderkit.html.ScrollableDataTableBaseRenderer=OFF
            log4j.logger.org.richfaces.component.UIScrollableDataTable=OFF
            log4j.logger.org.richfaces.convert.selection.ClientSelectionConverter=OFF
            log4j.logger.org.richfaces.model.DataModelCache=OFF
            log4j.logger.org.richfaces.skin.SkinFactoryImpl=OFF
            
            log4j.rootLogger=ALL, CONSOLE, LOG
            
            log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
            log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
            log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} %-5p %c %M - %m\n
            
            log4j.appender.stdout=org.apache.log4j.ConsoleAppender
            log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
            log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} %-5p %c %M - %m\n
            
            log4j.appender.LOG=org.apache.log4j.DailyRollingFileAppender
            log4j.appender.LOG.file=logs\\app.log
            log4j.appender.LOG.datePattern='.'yyyy-MM-dd
            log4j.appender.LOG.layout=org.apache.log4j.PatternLayout
            log4j.appender.LOG.layout.ConversionPattern=%d{ISO8601} %-5p %c %M - %m\n
            
            log4j.appender.fileout=org.apache.log4j.DailyRollingFileAppender
            log4j.appender.fileout.file=logs\\app.log
            log4j.appender.fileout.datePattern='.'yyyy-MM-dd
            log4j.appender.fileout.layout=org.apache.log4j.PatternLayout
            log4j.appender.fileout.layout.ConversionPattern=%d{ISO8601} %-5p %c %M - %m\n
            


            Whatty


            • 3. Re: Ajax4jsf pollutes log4j output
              alfons12

              Thank you for reply, but it still doesn't work:

              log4j.properties

              log4j.threshold=ALL
              
              log4j.logger.org.ajax4jsf=OFF
              
              log4j.rootLogger=ALL, LOG
              
              log4j.appender.LOG=org.apache.log4j.DailyRollingFileAppender
              log4j.appender.LOG.file=out.log
              log4j.appender.LOG.layout=org.apache.log4j.PatternLayout
              log4j.appender.LOG.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n%n%n%n
              


              part of out.log
              19:56:36,561 DEBUG sax:1341 - setDocumentLocator(com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser$LocatorProxy@5881e7)
              
              
              
              19:56:36,563 DEBUG sax:1375 - startDocument()
              
              
              
              19:56:36,564 DEBUG sax:1410 - startElement(,,resource-config)
              
              
              
              19:56:36,565 DEBUG Digester:1417 - Pushing body text ''
              
              
              
              19:56:36,565 DEBUG Digester:1436 - New match='resource-config'
              
              
              
              19:56:36,566 DEBUG Digester:1464 - No rules found matching 'resource-config'.
              
              
              
              19:56:36,567 DEBUG sax:1094 - characters(
               )
              
              
              
              19:56:36,567 DEBUG sax:1410 - startElement(,,resource)
              
              
              
              19:56:36,568 DEBUG Digester:1417 - Pushing body text '
               '
              
              
              
              19:56:36,569 DEBUG Digester:1436 - New match='resource-config/resource'
              
              
              
              19:56:36,569 DEBUG Digester:1451 - Fire begin() for ObjectCreateRule[className=org.ajax4jsf.framework.resource.JarResource, attributeName=class]
              
              
              
              19:56:36,570 DEBUG Digester:200 - [ObjectCreateRule]{resource-config/resource}New org.ajax4jsf.framework.ajax.AjaxScript
              
              
              
              19:56:36,571 DEBUG Digester:1451 - Fire begin() for SetNextRule[methodName=addResource, paramType=org.ajax4jsf.framework.resource.InternetResource]
              .
              .
              .
              


              Any suggestion?

              • 4. Re: Ajax4jsf pollutes log4j output

                Those look like SAX digester messages, try the line from my example

                log4j.logger.org.apache.commons.digester=OFF
                


                Each component in the system has the ability to use it's own logger, essentially creating a logging namespace which can be controlled independently of each other.

                Whatty

                • 5. Re: Ajax4jsf pollutes log4j output
                  alfons12

                  Now it works as expected.
                  Thank you very much.

                  • 6. Re: Ajax4jsf pollutes log4j output

                    Again, be careful with this since turning off debugging messages can be misleading when things do start to go awry since you will have no indication that things are going wrong.

                    Rather than turning if off completely you may wish to set it too ERROR but once you have things working turning OFF completely is nice as well.