Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
toggle
J S
Mojarra logging messagse going missing
17 aprile 2012 6.47
Risposta

J S

Punteggio: Junior Member

Messaggi: 31

Data di Iscrizione: 11 aprile 2012

Messaggi recenti

Hi,

I'm finding that logging messages from the mojarra library aren't appearing in any of the tomcat or liferay log files. They did when the application was servlet based.

Mojarra uses Java SE Logging. I am currently finding that the PartialViewContextImpl class is catching an exception and logging it, but I never see the message. This is making tracking problems down quite hard!

I've tried making tomcat use log4j but this hasn't helped.

Is there an example of setting up logging in liferay with mojarra?

Thanks

John
Neil Griffin
RE: Mojarra logging messagse going missing
17 aprile 2012 8.25
Risposta

Neil Griffin

LIFERAY STAFF

Punteggio: Liferay Legend

Messaggi: 2353

Data di Iscrizione: 26 luglio 2005

Messaggi recenti

Are you using PortletFaces Bridge? Liferay Faces Bridge has a new class named ExceptionHandlerAjaxImpl that might help with the logging issue you mentioned. It should be registered automatically if you have the liferay-faces-bridge-impl JAR in your portlet's WEB-INF/lib folder.
J S
RE: Mojarra logging messagse going missing
17 aprile 2012 9.28
Risposta

J S

Punteggio: Junior Member

Messaggi: 31

Data di Iscrizione: 11 aprile 2012

Messaggi recenti

I'm using


<dependency>
<groupId>com.liferay.faces</groupId>
<artifactId>liferay-faces-bridge-impl</artifactId>
<version>3.0.0-BETA1</version>
</dependency>
<dependency>
<groupId>com.liferay.faces</groupId>
<artifactId>liferay-faces-alloy</artifactId>
<version>3.0.0-BETA1</version>
</dependency>


Log messages from my app come out ok, just the ones from the mojarra library. I can step over it in the debugger and see it go into the method, but somehow it's not coming out in the log file.

Thanks,

John
Neil Griffin
RE: Mojarra logging messagse going missing
17 aprile 2012 9.37
Risposta

Neil Griffin

LIFERAY STAFF

Punteggio: Liferay Legend

Messaggi: 2353

Data di Iscrizione: 26 luglio 2005

Messaggi recenti

If you set a breakpoint in ExceptionHandlerAjaxImpl at line 62, does line 62 get reached?
1if (throwable != null) {
2    logger.error(throwable); // LINE 62
3}
J S
RE: Mojarra logging messagse going missing
18 aprile 2012 2.23
Risposta

J S

Punteggio: Junior Member

Messaggi: 31

Data di Iscrizione: 11 aprile 2012

Messaggi recenti

No, because the exception is handled just by logging it, it doesn't get queued. It's this bit in PartialViewContextImpl.processPartial

 1
 2            try {
 3                processComponents(viewRoot, phaseId, executeIds, ctx);
 4            } catch (Exception e) {
 5                if (LOGGER.isLoggable(Level.INFO)) {
 6                    LOGGER.log(Level.INFO,
 7                           e.toString(),
 8                           e);
 9                }
10            }


where logger is a java.util.logging.Logger

I'm sure it's just a configuration issue, but I can't work out what!

John
Neil Griffin
RE: Mojarra logging messagse going missing
18 aprile 2012 8.24
Risposta

Neil Griffin

LIFERAY STAFF

Punteggio: Liferay Legend

Messaggi: 2353

Data di Iscrizione: 26 luglio 2005

Messaggi recenti

Maybe give SLF4J (with log4j as the impl) a try:
http://stackoverflow.com/questions/5125988/how-to-forward-jsf-ri-mojarra-log-to-slf4j-or-log4j
J S
RE: Mojarra logging messagse going missing
18 aprile 2012 8.28
Risposta

J S

Punteggio: Junior Member

Messaggi: 31

Data di Iscrizione: 11 aprile 2012

Messaggi recenti

It seems like you have to explicitly assign a handler in your webapp, the normal defaults don't seem to apply:

in WEB-INF/classes/logging.properties

1javax.enterprise.resource.webcontainer.jsf.handlers = java.util.logging.ConsoleHandler
2javax.enterprise.resource.webcontainer.jsf.level = DEBUG


Thanks for your help,

John
Neil Griffin
RE: Mojarra logging messagse going missing
18 aprile 2012 8.43
Risposta

Neil Griffin

LIFERAY STAFF

Punteggio: Liferay Legend

Messaggi: 2353

Data di Iscrizione: 26 luglio 2005

Messaggi recenti

Thanks John -- that's terrific info! I'm going to add this to the demo portlets. See FACES-1187