Switching Log4j mode to DEBUG in Weblogic Server

log4jweblogic

I am using weblogic 10.5 and my application has 4 managed servers, having the below mentioned configuration in weblogic startup script to enable log4j.

JAVA_PROPERTIES="${JAVA_PROPERTIES} -Dlog4j.configuration=file:${LOG4J_CONFIG_FILE}"

I have given the log4j.properties path to LOG4J_CONFIG_FILE.

I brought down the server, tried updating the log4j mode from ERROR to DEBUG in the loj.properties and bounced the server.

When the server restarts the loj.properties file is updated with ERROR mode.

Kindly advice

Best Answer

I would suggest using the console to perform this task. Log into the admin console and choose your managed server, proceed to logging -> Advanced and choose the Debug level of your choice. You could also be specific and choose the Debug tab and pick the one you want. There are many options you could choose from for the type of service you are trying to debug.

I think the weblogic turns it to ERROR because that would the default. You could start the weblogic server with strace and then output it a file and see what changes your log4j properties file.

Try starting weblogic with the option

$ strace -o output.txt ./startWeblogic.sh
$ grep log4j.properties output.txt

This should give you what youare looking for to trouble shoot.