Greetings!

 

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

 

pom.xml:

 

               <dependency>

                   <groupId>ch.qos.logback</groupId>

                   <artifactId>logback-classic</artifactId>

                   <version>1.0.7</version>

               </dependency>

 

 

Logback.xml:

 

<?xml version="1.0" ?>

<configuration debug="true">

 

       <appender class="ch.qos.logback.core.rolling.RollingFileAppender" name="InfoFileAppender">

              <append>true</append>

              <file>${jboss.server.log.dir}/maApp.log</file>

              <filter class="ch.qos.logback.classic.filter.ThresholdFilter">

                     <level>INFO</level>

              </filter>

              <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">

                     <fileNamePattern>${jboss.server.log.dir}/myApp.%d{yyyy-MM-dd}.gz</fileNamePattern>

                     <maxHistory>30</maxHistory>

              </rollingPolicy>

              <encoder>

                     <pattern>%date, %level, %logger, Account: %X{accountId} Session: %X{sessionId} %msg %ex%n</pattern>

              </encoder>

       </appender>

 

       <appender class="ch.qos.logback.core.rolling.RollingFileAppender" name="DebugFileAppender">

              <append>true</append>

              <file>${jboss.server.log.dir}/myApp-debug.log</file>

              <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">

                     <fileNamePattern>${jboss.server.log.dir}/myApp-debug.%d{yyyy-MM-dd}.gz</fileNamePattern>

                     <maxHistory>30</maxHistory>

              </rollingPolicy>

              <encoder>

                     <pattern>

                           %date, %level, %thread, %logger, %class, %method, %line: Account: %X{accountId} Session: %X{sessionId} %msg %ex%n

                     </pattern>

              </encoder>

       </appender>

 

       <root>

              <level value="debug" />

              <appender-ref ref="InfoFileAppender" />

              <appender-ref ref="DebugFileAppender" />

       </root>

 

</configuration>

 

 



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.