Foros de discusión

Individual log file for custom portlets on JBOSS Server 7.1.1

parikshit sharma, modificado hace 8 años.

Individual log file for custom portlets on JBOSS Server 7.1.1

Junior Member Mensajes: 53 Fecha de incorporación: 18/10/12 Mensajes recientes
Hi Folks,

As per blog of Denis(https://www.liferay.com/web/denis-signoretto/blog/-/blogs/using-slf4j-and-liferay-logging-framework-in-custom-plugins) I am trying to implement the individual logs for custom portlet on bundled JBOSS server 7.1.1 on LR6.1.10 CE, but it's generating the blank log file.I need your help to resolve this issue.
Below are the configurations I have done to implement it.
1.Added the dependencies for slf4j-api.jar and util-slf4j.jar file in pom.xml. And created the portal-log4j.xml file and log4j.dtd as describe in blog.
2.If I add the log4j.jar dependency in pom.xml , at the time of deployment it raise below exception.

java.lang.ClassCastException: org.apache.log4j.EnhancedPatternLayout cannot be cast to org.apache.log4j.Layout

I searched for it , and found that by adding the log4j.jar in portlet I am initializing it again, as it is already initialized by JBOSS. So I added below configuration

Added jboss-deployment-structure.xml ,with below configuration, to exclude the initialization by JBOSS server.
<exclusions>
<module name="javaee.api"></module>
<module name="org.apache.log4j"></module>
<module name="org.slf4j"></module>
<module name="org.slf4j.impl"></module>
<module name="org.jboss.logging"></module>
<module name="org.jboss.logging.jul-to-slf4j-stub"></module>
<module name="org.jboss.logmanager"></module>
<module name="org.jboss.logmanager.log4j"></module>
</exclusions>
But still it raise the same exception.

Please suggest what changes I should do in implementation to make it work.

Thanks.
Parikshit
thumbnail
Anil Sunkari, modificado hace 8 años.

RE: Individual log file for custom portlets on JBOSS Server 7.1.1

Expert Mensajes: 427 Fecha de incorporación: 12/08/09 Mensajes recientes
Hi Parikshit,


May be the below forum is helpful emoticon

click here

Regards,
Anil Sunkari