Fórum

Custom Log files for Portlets

Selva kumar, modificado 7 Anos atrás.

Custom Log files for Portlets

Junior Member Postagens: 39 Data de Entrada: 23/07/15 Postagens Recentes
I have developed 3 portlets and packed each portlets in seperate WAR file. I have included the log4j.dtd and log4j.xml so that the seperate log files will be generated for each portlets. It is easy for me for analyse the issues using the log files if anything went wrong in any of the portlets.

But I got a requirement now to package all the portlets in single WAR. I don't know how to manage above situation now. I need define seperate log files for each portelts in the WAR. is it possible? if so how would be the configuration?
thumbnail
Denis Signoretto, modificado 7 Anos atrás.

RE: Custom Log files for Portlets

Expert Postagens: 375 Data de Entrada: 21/04/09 Postagens Recentes
Hi selva,

This article can help you

https://web.liferay.com/it/web/brett.swaim/blog/-/blogs/using-log4j-to-ensure-each-portlet-has-it-s-own-log-file

Just define multiple appender an related categories.
HTH

Denis
thumbnail
David H Nebinger, modificado 7 Anos atrás.

RE: Custom Log files for Portlets

Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
Just my opinion, but I think you're over thinking things. In production, whether one war or many wars, you're not going to have a lot of debug logging going on. You're only going to turn that on for whatever code is giving you problems lest you negatively impact production performance.

When you look at it from this point of view, I think it should be apparent that burning cycles to set up and maintain separate logs will only take cycles away from real development activities.