Not able to change the logging level log4j on Payara server

35 views Asked by At

I would like to change the logging level of log4j without redeploy on Payara server.

I go to /opt/payara/payara5.2022.5/glassfish/domains/DEV01/applications/myapp then find the log4j.properties file. change property log4j.logger.com.hoanphan = DEBUG to log4j.logger.com.hoanphan = INFO. After saved file, I restart server. However, Payara still logs with DEBUG level. It only work once I redeploy. Is there any way to change the log level without redeploy server?

1

There are 1 answers

2
OndroMih On

If you want to change log4j properties without redeployment, you need to copy the log4j.properties file to the lib/classes directory in the domain. In your case to /opt/payara/payara5.2022.5/glassfish/domains/DEV01/lib/classes/log4j.properties. This will put it on the classpath of your application and any changes there will be reflected after you restart server or restart/redeploy your application.