1

I want to change the log level without restarting the server. I use weblogic server. For this I thought to pass the log level from a external file (LOGBackIncludedFile.xml) and give this file path in the logback <include file>. I cannot hard code the path, as the path is different in Dev, UAT, Production. I want to include this file in a location inside Weblogic 12C server. So I can change log level without touching ear file.

<configuration scan="true" scanPeriod="30 seconds"> <include file="../../LOGBackIncludedFile.xml" /> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender" > <encoder> <pattern>%date %-5level [%logger] > %msg%n</pattern> </encoder> </appender> <root level="${root.level:-DEBUG}"> <appender-ref ref="STDOUT" /> </root> </configuration> 

Below is the LOGBackIncludedFile.xml

<included> <property value="INFO" name="root.level"/> </included> 

when I use this existing xml I get this error.

 java.io.FileNotFoundException: /usrXX/appXX/oracle/product/XXX/domains/XXXDomain/../../LOGBackIncludedFile.xml 

My question is how can I set external file path dynamically in the logback.xml. The path should be to the specific weblogic instance. As I put the external file into my instance.

eg : /usrxx/appxx/oracle/product/XXX/domains/xxxDomain/servers/myInstance/

2
  • You can change the log level through the admin console, WLST, or JMX... Something like 176.34.122.30/blog/2010/04/22/… Does that work for you or are you asking something else? Commented Jun 22, 2015 at 23:21
  • @DisplayNameismissing something like this. But I cannot change any server setting. So I am thinking of an simple way of doing it. Commented Jun 23, 2015 at 6:24

1 Answer 1

1

Set the file path as below. This is for weblogic 12C.

 <include optional="true" file="${DOMAIN_HOME}/servers/${SERVER_NAME}/LOGBackIncludedFile.xml" /> 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.