I want to move to Logback
from java.util.logging.Logger
. First I use this in my dependency.jar
file. MyApp.ear
is still use java logger
.
Below is logback.xml
.
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<!-- encoders are assigned the type
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{5} - %msg%n
</pattern>
</encoder>
</appender>
<root level="WARN">
<appender-ref ref="STDOUT" />
</root>
</configuration>
I added below depended jar files to my ant build
file.
<pathelement location="${global.lib}/slf4j-api-1.6.4.jar"/>
<pathelement location="${global.lib}/logback-classic-1.0.1.jar"/>
I use weblogic 12C
. Now my log level is WARN
. But still the INFO
logs are printing. Which means it still uses java logger
. I suspect the dependent.jar
logback
log
is overwritten by java logger
in MyApp.ear
.
I am not sure is there any place to modify in the weblogic 12C
to enable it.
logback.xml
is available inside the dependency.jar
.
I added below jar path to my
build.xml
Additionally I added below code to my
weblogic-application.xml
.This resolved my issue.