6

Is there a way to set Liferay's global logging level? I am aware of it's console in the Server Administration but I want to set a global level not to a package level.

Thanks!

cachiama
  • 590
  • 3
  • 19

2 Answers2

4

Because of the way log4j can be configured, any global setting can be overridden by a package level setting.

You can remove any configuration individual packages (if you have any). Then the setting for the rootLogger will take effect.

log4j.rootLogger=INFO, stdout

Update

To override Liferay's default logging settings, you can create a portal-log4j-ext.xml. Just define a logger for the package com.liferay and you should be good to go.

adarshr
  • 61,315
  • 23
  • 138
  • 167
  • I agree, do you know a way to remove the declarations of each package in liferay? I can't configure each of the 237 different packages. Thanks – cachiama Feb 07 '13 at 11:46
  • I am using glassfish and can't find where to put the file for it to work. Tried also this link but it's not resolved: http://www.liferay.com/community/forums/-/message_boards/message/14793695 – cachiama Feb 07 '13 at 12:12
  • Looks like it doesn't work in Glassfish. I'm afraid you maybe out of luck. If you use Enterprise version of Liferay, I suggest you raise a ticket. – adarshr Feb 07 '13 at 12:59
  • When I change portal-log4j-ext.xml does it need a liferat restart? If so; is there a workaround to that requirement? I can't get my logs to show. – Joel Peltonen Nov 27 '15 at 06:19
2

Fixed it by unpacking portal-impl.jar found in $server/applications/liferay-portal/WEB-INF/lib and replacing the contents of META-INF/portal-log4j.xml with my requirements.

cachiama
  • 590
  • 3
  • 19