留言板

Custom Log files for Portlets

Selva kumar,修改在8 年前。

Custom Log files for Portlets

Junior Member 帖子: 39 加入日期: 15-7-23 最近的帖子
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,修改在7 年前。

RE: Custom Log files for Portlets

Expert 帖子: 375 加入日期: 09-4-21 最近的帖子
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,修改在7 年前。

RE: Custom Log files for Portlets

Liferay Legend 帖子: 14919 加入日期: 06-9-2 最近的帖子
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.