I wrote a web-app with various frameworks(jsf,Spring,Hibernate) and my logger library is Logback and slf4j.
At the moment I'm not able to display uncaught exceptions(for example NullPointers) in log file.
This is my logBack.xml
<configuration debug="true">
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${CATALINA_HOME}/logs/jsfDemo.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>jsfDemo.%d{yyyy-MM-dd}.log.zip</fileNamePattern>
<maxHistory>30</maxHistory>
</rollingPolicy>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{35} - %msg%n</pattern>
</encoder>
</appender>
<root level="DEBUG">
<appender-ref ref="FILE" />
</root>
</configuration>
when I execute this few lines of code with uc=null
public void nullPointerMethod(UserCredential uc){
LOG.debug(">>login(uc)");
if(uc == null){
throw new NullPointerException();
}else{
//do something
}
LOG.debug("<<login(uc)");
}
in the logFile I see only
>>login(uc)
but I want to see stackTrace of NullPointer. What's wrong?