Pregunta

I am developing a web application and I need to log page requestes by client. So that, I implemented PhaseListener from this link.

In this tutorial, in final comments section which is end of the page suggests that;

"Using a phase listener can be a worthwhile tool during development as it gives you ready feedback as to what is going on within the innards of JSF.
Just remember to turn this diagnostic tool off in production!"

I don't understand why I need to turn off phase listener in production. Would you tell me advantages and disadvantages of using phaselistener in production ?

Regards.

¿Fue útil?

Solución

That sentence was poorly phrased. It's not talking about phase listeners in general, but about the specific phase listener being discussed in the tutorial, who is merely printing the currently processed phases of the JSF life cycle (that article clearly borrowed the idea from my article which was published more than 2 years therebefore). In production, that would only cause irrelevant clutter in server log file who nobody is looking at and would make finding the real relevant log entries much harder.

On the other hand, if your sole functional requirement is "page request logging" (and thus not "JSF phase logging"), then this can more efficiently be done with a simple servlet filter.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top