Liferay logging level

2019-03-29 21:33发布

问题:

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!

回答1:

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.



回答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.