4

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?

BhavikKama
  • 8,566
  • 12
  • 94
  • 164
Adia
  • 1,171
  • 5
  • 16
  • 33

1 Answers1

9

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.

Mark
  • 17,887
  • 13
  • 66
  • 93
  • Thanks for the answer. I did those and just need to do some testing to see if it is working properly. By the way, it needs these two lines at the beginning, in case some else tries this solution: – Adia Mar 28 '13 at 14:57
  • Didn't work for me in 6.1.1 GA2 CE - maybe it's a EE feature? Tried to suppress massive NoSuchFileExptions from document library when working on local dev env with a DB dump from a live system. – kidata Dec 05 '14 at 13:24