In JSF 1.2 how do I changing Logging level of RenderResponsePhase?

老子叫甜甜 提交于 2019-12-01 10:04:30

问题


I am getting the following messsage in System out: "FacesMessage(s) have been enqueued....".

The solution with Sun's JavaServer Faces implementation (1.2_07-b03-FCS) was to add this to web.xml:

<context-param>
    <description>
    Set to true to disable the following warning message:
    FacesMessage(s) have been enqueued, but may not have been displayed
    </description>
    <param-name>com.ibm.ws.jsf.disableEnqueuedMessagesWarning</param-name>
    <param-value>true</param-value>
</context-param>

But for some reason that solution does not work with this Implemenation that I am using Mojarra (1.2_15-b01-FCS).

This document says I need to simply change the logger of RenderResponsePhase.
Faces Message(s) habe been encoded...

Essentially, I think I am asking is what is the logger class I need to configure for the RenderResponsePhase.


回答1:


That context parameter is specific to IBM's Faces Client Framework which is part of WebSphere. But you seem to be not using it at all. There's no point of adding that context parameter. Remove it altogether.

Mojarra uses java.util.logging API as loggers. The logger name of the JSF lifecycle logger (which the RenderResponsePhase is using) is:

javax.enterprise.resource.webcontainer.jsf.lifecycle

The loggers are configureable by JRE/lib/logging.properties file. You first need to determine what JRE your server environment is using (note: the JDK has also a JRE!) and then edit its JRE/lib/logging.properties file accordingly to add the following line:

javax.enterprise.resource.webcontainer.jsf.lifecycle.level = WARNING

This sets the loggable level one up to "WARNING". The "FacesMessage(s) have been enqueued" message is an namely an "INFO". You need to restart the server (and the IDE, if any!) for the change to take effect.

I however wonder how useful it is to disable that. The root cause of the "problem" which you're trying to hide might better have been solved differently.



来源:https://stackoverflow.com/questions/7162134/in-jsf-1-2-how-do-i-changing-logging-level-of-renderresponsephase

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!