Avoid log trace of external framework J2EE

63 views Asked by At

I have an J2EE application with Liferay using an external framework (DWR). That framework is tracing in the log a lot of useless info with "INFO" level.

I have set the package of framework (uk.ltd.getahead.dwr) with "ERROR" level, however this is not working.

Liferay uses log4j. I have searched about it and DWR uses log4j too.

2

There are 2 answers

1
AndersG On

Try to check if the jar of the framework contains it's own log configuration file, logback.xm or similar. Then that file is the one controlling the output.

2
Steve C On

Try adding a log4j.xml file to your web (portlet?) application and configure a file based appender in it, rather than the normal "console" appender.

This should direct all logging generated by your application to a file and avoid the "catch all" console log.

Your web application occupies a different class loader than the Liferay portal components and can therefore control it's own logging (assuming that you have log4j.jar within your own app in WEB-INF/lib).