Merge pull request #182 from muff1nman/log-errors

Log Errors
master
Tom Powell 8 years ago committed by GitHub
commit c2f9803adc
  1. 4
      libresonic-main/pom.xml
  2. 26
      libresonic-main/src/main/java/org/libresonic/player/spring/LoggingExceptionResolver.java
  3. 1
      libresonic-main/src/main/webapp/WEB-INF/libresonic-servlet.xml
  4. 5
      pom.xml

@ -38,6 +38,10 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>

@ -0,0 +1,26 @@
package org.libresonic.player.spring;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.libresonic.player.Logger;
import org.springframework.core.Ordered;
import org.springframework.web.servlet.HandlerExceptionResolver;
import org.springframework.web.servlet.ModelAndView;
public class LoggingExceptionResolver implements HandlerExceptionResolver, Ordered {
private static final Logger logger = Logger.getLogger(LoggingExceptionResolver.class);
@Override
public ModelAndView resolveException(
HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, Exception e
) {
logger.error("Exception occurred", e);
return null;
}
@Override
public int getOrder() {
return Integer.MIN_VALUE;
}
}

@ -366,4 +366,5 @@
<property name="suffix" value=".jsp"/>
</bean>
<bean class="org.libresonic.player.spring.LoggingExceptionResolver" />
</beans>

@ -95,6 +95,11 @@
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>

Loading…
Cancel
Save