Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Liferay logging

I know you could define the log level for liferay log on the path

/liferay-portal-6.1.10-ee-ga1/logs/liferay.yyyy-mm-dd.log through Control Panel -> Server Adminstration -> Log levels

. But this is so hard to do, since there are many pages to go through and so many classes or packages. Is there a way I could set all the levels to WARN from one single place?

In Log4j properties file I have defined a log file in a different place and set the log level there to WARN. This works. Can I do another setting in the same Log4j properties file for this path as well:

/liferay-portal-6.1.10-ee-ga1/logs/liferay.yyyy-mm-dd.log?

like image 712
Adia Avatar asked Jan 13 '23 19:01

Adia


1 Answers

That is posible. Create herefor a directory: LIFERAY-PORTA/tomcat-7.XXXXX/lib/ext/META-INF

and put there to files: 1. portal-log4j-ext.xml 2. log4j.dtd // this you get from portal-impl.jar/META-INF/

Config portal-log4j-ext.xml

<?xml version="1.0"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">

    <category name="com.liferay.portal">
        <priority value="ERROR" />
    </category>

    <category name="my.portlet.soccer">
        <priority value="DEBUG" />
    </category>

</log4j:configuration>

ready.

like image 133
Mark Avatar answered Feb 28 '23 05:02

Mark