SLF4J stops console login

I have installed a web application for logging messages with SLF4J and logback. I configured logback to write messages to the console and to a log file, but when I deploy the application at some point, I stop receiving messages to the console.

I've tried various configurations with varying results. With glassfish, everything seems to be fine until I run:

SLF4JBridgeHandler.removeHandlersForRootLogger();
SLF4JBridgeHandler.install();

      

At this point, no logs are output to the console.

With weblogic, without even installing SLF4JBridgeHandler after redeploying the app, I stop getting log messages to the console (JUL logging still appears in the console). On first deployment, I can also make console logging fail if I throw a servlet exception before any other logging occurs.

I tried using log4j2 as my logging implementation but the results were the same.

Don't know why the console log is breaking

Using SLF4J 1.7.12 logback 1.1.3 glaze 3.1.2.2 weblogic 12c here is my config:

<configuration debug="true" scan="true">
<property name="LOG_FILE_NAME" value="compass" />
<timestamp key="byDay" datePattern="yyyyMMdd"/>
<statusListener class="ch.qos.logback.core.status.OnConsoleStatusListener" />  
<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
    <resetJUL>true</resetJUL>
</contextListener>
<jmxConfigurator />
<appender name="compass-con" class="ch.qos.logback.core.ConsoleAppender">
    <encoder>
        <pattern>%highlight(%-25(%date) %-5level) %cyan(%logger{5}) %msg%n</pattern>            
    </encoder>
</appender>
<appender name="compass-async-con" class="ch.qos.logback.classic.AsyncAppender">
    <queueSize>5000</queueSize>
    <appender-ref ref="compass-con"/>        
</appender>
<logger name="com.ciminc" level="DEBUG"/>      
<logger name="org.hibernate" level="INFO"/>
<logger name="org.jboss.seam" level="INFO"/>
<logger name="com.icesoft" level="INFO"/>
<logger name="org.icesoft" level="INFO"/>
<logger name="javax.faces.view.facelets" level="INFO"/>
<logger name="org.springframework" level="INFO"/>
<logger name="ch.qos" level="DEBUG"/>
<root level="INFO">
    <!--<appender-ref ref="compass-async-file" />-->
    <appender-ref ref="compass-async-con"/>
</root>   

      

weblogic.xml:

  <container-descriptor>
<prefer-application-packages>
  <package-name>antlr</package-name>
  <package-name>org.apache.log4j</package-name>
  <package-name>org.joda</package-name>
  <package-name>ch.qos.logback</package-name>
  <package-name>org.slf4j</package-name>
  <package-name>org.apache.commons</package-name>
</prefer-application-packages>
<prefer-application-resources>
  <resource-name>org.slf4j</resource-name>
  <resource-name>ch.qos.logback</resource-name>
  <resource-name>org.apache.commons</resource-name>
</prefer-application-resources>

      

+3


source to share





All Articles