Pretty faces log messages

Splash Forums Rewrite Users Pretty faces log messages

This topic contains 5 replies, has 2 voices, and was last updated by  Christian Kaltepoth 5 months, 3 weeks ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #27350

    simodrum
    Participant

    Hello,
    I’m using rewrite-servlet/2.0.12.Final and rewrite-config-prettyfaces/2.0.12.Final in my JSF2+Primefaces project.
    I use prettyfaces only to make prettier the urls of the page of my web application (e.g. removing the .xhtml extension of the pages or similar).

    Since the update of the version of my AS (which is Payara Server 4.1.1.161) I have strange log info on certain pages every time I perform a redirect using FacesContext.getCurrentInstance().getExternalContext().redirect(url_to_redirect);

    This is an example of the server log:

    
    Info:   [
    Info:   com.ocpsoft.pretty.faces2.application.PrettyNavigationHandler
    Info:   ] :
    Info:   Navigation requested: fromAction [#{searchBar.search()}], outcome [null]
    Info:   [
    Info:   com.ocpsoft.pretty.faces2.application.PrettyNavigationHandler
    Info:   ] :
    Info:   Not a PrettyFaces navigation string - passing control to default nav-handler

    The search() method is simply a method that performs a redirect as I told before.

    This problem is not exactly a problem since the behavior of the method is correct, but this kind of messages messes up my server log which is a bit annoying when I have to check them for errors.

    This is my pretty-config.xml configuration for page of the example.

        <url-mapping>
            <pattern value="/search"/>
            <view-id value="/search.xhtml"/>
        </url-mapping>

    Anyone knows how to disable this messages? Am I doing something wrong in the pretty config configuration?

    Thanks.
    Simone

    #27351

    This is a debug log message:

    https://github.com/ocpsoft/rewrite/blob/c8fbb569cfd4e20de6ec26a8efea2abfcc8a8f37/config-prettyfaces/src/main/java/com/ocpsoft/pretty/faces2/application/PrettyNavigationHandler.java#L60

    Not sure why it appears in your logs. By default Rewrite logs using the standard java.util.logging API. So it looks like a configuration issue.

    You can also log using SLF4J instead. To do so, just include the following dependency in your project:

    https://search.maven.org/#artifactdetails%7Corg.ocpsoft.logging%7Clogging-adapter-slf4j%7C1.0.4.Final%7Cjar

    #27352

    simodrum
    Participant

    Thanks for the reply Christian.

    I’m using the standard java.util.logging API in my application with standard configuration provided by the AS, so I guess that something changed in the new version. I prefer not to use log4j since is not necessary. Is there a way to “redefine” the logging behavior only for pretty config? Something like a specific logging property for pretty faces?

    I found this configuration on the documentation

    ### direct log messages to stdout ###
    log4j.appender.stdout=org.apache.log4j.ConsoleAppender
    log4j.appender.stdout.Target=System.out
    log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
    log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
    
    log4j.rootLogger=warn, stdout
    
    ### Log for OCPsoft
    log4j.logger.com.ocpsoft=info

    but it is clearly referred to log4j.

    #27354

    I guess it is simply a configuration issue with your logging. Typically you shouldn’t see DEBUG level log outputs unless you have a logging configuration that enables this for certain logging categories. Please double check the logging configuration of you server.

    #27355

    simodrum
    Participant
    #All log level details
    com.sun.enterprise.server.logging.GFFileHandler.level=ALL
    com.sun.enterprise.server.logging.SyslogHandler.level=ALL
    javax.enterprise.system.tools.admin.level=INFO
    org.apache.jasper.level=INFO
    javax.enterprise.system.core.level=INFO
    javax.enterprise.system.core.classloading.level=INFO
    java.util.logging.ConsoleHandler.level=FINEST
    javax.enterprise.system.tools.deployment.level=INFO
    javax.enterprise.system.core.transaction.level=INFO
    org.apache.catalina.level=INFO
    org.apache.coyote.level=INFO
    javax.level=INFO
    javax.enterprise.system.util.level=INFO
    javax.enterprise.resource.resourceadapter.level=INFO
    javax.enterprise.system.core.config.level=INFO
    javax.enterprise.system.level=INFO
    javax.enterprise.system.core.security.level=INFO
    javax.enterprise.system.container.cmp.level=INFO
    javax.enterprise.system.core.selfmanagement.level=INFO
    .level=INFO
    javax.enterprise.resource.jdo.level=INFO
    javax.enterprise.resource.sqltrace.level=FINE
    org.jvnet.hk2.osgiadapter.level=INFO
    javax.enterprise.system.ssl.security.level=INFO
    ShoalLogger.level=CONFIG
    
    javax.enterprise.resource.corba.level=INFO
    javax.enterprise.resource.jta.level=INFO
    javax.enterprise.system.webservices.saaj.level=INFO
    javax.enterprise.system.container.ejb.level=INFO
    javax.enterprise.system.container.ejb.mdb.level=INFO
    javax.enterprise.resource.javamail.level=INFO
    javax.enterprise.system.webservices.rpc.level=INFO
    javax.enterprise.system.container.web.level=INFO
    javax.enterprise.resource.jms.level=INFO
    javax.enterprise.system.webservices.registry.level=INFO
    javax.enterprise.resource.webcontainer.jsf.application.level=INFO
    javax.enterprise.resource.webcontainer.jsf.resource.level=INFO
    javax.enterprise.resource.webcontainer.jsf.config.level=INFO
    javax.enterprise.resource.webcontainer.jsf.context.level=INFO
    javax.enterprise.resource.webcontainer.jsf.facelets.level=INFO
    javax.enterprise.resource.webcontainer.jsf.lifecycle.level=INFO
    javax.enterprise.resource.webcontainer.jsf.managedbean.level=INFO
    javax.enterprise.resource.webcontainer.jsf.renderkit.level=INFO
    javax.enterprise.resource.webcontainer.jsf.taglib.level=INFO
    javax.enterprise.resource.webcontainer.jsf.timing.level=INFO
    javax.org.glassfish.persistence.level=INFO
    javax.enterprise.system.tools.backup.level=INFO
    org.glassfish.admingui.level=INFO
    org.glassfish.naming.level=INFO
    org.eclipse.persistence.session.level=INFO
    javax.enterprise.system.tools.deployment.dol.level=WARNING
    javax.enterprise.system.tools.deployment.common.level=WARNING

    These are my logging.properties. The only two voices that make me think are the first and the second that are setted to ALL.

    It could be?

    #27356

    Sorry, I must correct myself. I just checked the PrettyFaces code again and just saw, that we are actually using Apache Commons Logging in this class. Sorry about that.

    AFAIK Apache Common Logging uses reflection and class lookups to check which logging framework to use. But I’m not about the details. Perhaps you could check if there are known issues with Apache Commons Logging and you container!?!

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.

Comments are closed.