[logback-user] Ignoring specific packages?

Pegram, David dpegram at biosignia.com
Mon Nov 26 17:54:17 CET 2012

Thank you for your help Chris!  I was able to get the JUL messages bridged to SLF4J and logged in the appropriate logback managed files.

However, as a result I'm picking up a lot of "noise" from other packages.  I've turned them down using the following configuration options (see below).  Can someone tell me if there is a way to exclude them from the two appenders without affecting higher level handlers?  For example, I'd like to ignore messages from "org.jboss.*" and let the container continue to handle its own logging.  Unfortunately, setting the "org.jboss" level to "OFF" has a side-effect of disabling the container's logging too (server.log).

Thank you!

-          D. Pegram

       <logger name="javax.enterprise" level="WARN" />
       <logger name="org.springframework" level="WARN" />
       <logger name="javax.faces" level="INFO" />
       <logger name="org.apache" level="INFO" />
       <logger name="org.hibernate" level="WARN" />
       <logger name="org.primefaces" level="INFO" />
       <logger name="ch.qos.logback" level="WARN" />

       <logger name="org.jboss" level="INFO" />

       <root level="DEBUG">
              <appender-ref ref="InfoFileAppender" />
              <appender-ref ref="DebugFileAppender" />

From: logback-user-bounces at qos.ch [mailto:logback-user-bounces at qos.ch] On Behalf Of Chris Pratt
Sent: Tuesday, November 20, 2012 5:00 PM
To: logback users list
Subject: Re: [logback-user] Logging uncaught exceptions that go to server.log

There's an extremely good probability that those statements are being written to the java.util.logging subsystem.  If you would like those bridged over to your Logback for processing, look into the SLF4j Bridge Handler (http://www.slf4j.org/api/org/slf4j/bridge/SLF4JBridgeHandler.html)

On Tue, Nov 20, 2012 at 1:40 PM, Pegram, David <dpegram at biosignia.com<mailto:dpegram at biosignia.com>> wrote:

I have a web app built with Maven I've added Logback to handle the logging with two rolling file appenders. Unfortunately, some exceptions (below) still bubble up to the server.log and are not captured in the logback generated files. How can I capture these with logback and keep them out of server.log?

15:46:41,888 SEVERE [javax.enterprise.resource.webcontainer.jsf.context] (http-) JSF1073: javax.faces.event.AbortProcessingException caught during processing of PROCESS_VALIDATIONS 3 : UIComponent-ClientId=templateForm:ddlCarrierView, Message=/foo/bar.xhtml @144,91 valueChangeListener="#{BackingBean.method}": java.lang.NullPointerException
15:46:41,889 SEVERE [javax.enterprise.resource.webcontainer.jsf.context] (http-) /foo/bar.xhtml @144,91 valueChangeListener="#{BackingBean.method}": java.lang.NullPointerException: javax.faces.event.AbortProcessingException: /foo/bar.xhtml @144,91 valueChangeListener="#{BackingBean.method}": java.lang.NullPointerException
       at javax.faces.event.MethodExpressionValueChangeListener.processValueChange(MethodExpressionValueChangeListener.java:157) [jboss-jsf-api_2.1_spec-2.0.2.Final-redhat-1.jar:2.0.2.Final-redhat-1]
Caused by: java.lang.NullPointerException
       at my.app.BackingBean.method(BackingBean.java:298) [classes:]

Below are the relevant configuration pieces.

Thank you for your help!

-          D. Pegram




<?xml version="1.0" ?>
<configuration debug="true">

       <appender class="ch.qos.logback.core.rolling.RollingFileAppender" name="InfoFileAppender">
              <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
              <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
                     <pattern>%date, %level, %logger, Account: %X{accountId} Session: %X{sessionId} %msg %ex%n</pattern>

       <appender class="ch.qos.logback.core.rolling.RollingFileAppender" name="DebugFileAppender">
              <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
                           %date, %level, %thread, %logger, %class, %method, %line: Account: %X{accountId} Session: %X{sessionId} %msg %ex%n

              <level value="debug" />
              <appender-ref ref="InfoFileAppender" />
              <appender-ref ref="DebugFileAppender" />


The contents contained herein may contain confidential information. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, printing or action taken on the contents is strictly prohibited. If you have received this email in error, please notify the sender immediately and delete this message.

Logback-user mailing list
Logback-user at qos.ch<mailto:Logback-user at qos.ch>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20121126/d0129e38/attachment-0001.html>

More information about the Logback-user mailing list