Legacy Knowledge Base
Published Sep. 10, 2025

In a clustered environment, log level changes may not be reflected

Written By

Shimada Taro

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

event

  • cluster environment.
  • When the log level was changed from Control Panel > Server Administration > Log Levels, the logs were not output.
  • The log level you set may change each time you access the site.

Environment

  • DXP 7.0+

solution

  • The fact that the settings appeared to be different for each access may be due to the fact that the nodes to be accessed were sorted by the load balancer.
    It is also possible that some tasks are executed only on the Master node, so that operations in categories set to DEBUG in Slave may not throw a log.
  • DEBUG logging must be enabled on each node or a permanent log level change using log4j is required.

Additional Information

  • Feature RequestLPS-162159
  • As a workaround, you can update the log level for the entire cluster by running the following Groovy script
// Specify the new log levels

def newLogLevels = [
"com.liferay.petra.mail": "DEBUG",
]

// Create a cluster request to update the log level on every cluster node

import com.liferay.petra.log4j.Log4JUtil
import com.liferay.petra.reflect.ReflectionUtil
import com.liferay.portal.kernel.cluster.ClusterExecutorUtil
import com.liferay.portal.kernel.cluster.ClusterRequest
import com.liferay.portal.kernel.util.MethodHandler
import java.lang.reflect.Method

Method method = ReflectionUtil.getDeclaredMethod(Log4JUtil.class, "setLevel", String.class, String.class, Boolean.TYPE)

newLogLevels.each({
MethodHandler methodHandler = new MethodHandler(method, it.key, it.value, Boolean.TRUE)
ClusterRequest clusterRequest = ClusterRequest.createMulticastRequest(methodHandler)
ClusterExecutorUtil.execute(clusterRequest)
})

Did this article resolve your issue ?

Legacy Knowledge Base