认为这对开发阶段来说是一个有用的功能。这是我可以配置或需要编码的东西吗?谢谢堆叠器!
答案 0 :(得分:4)
添加到pom.xml:
<dependency>
<groupId>com.github.isrsal</groupId>
<artifactId>spring-mvc-logger</artifactId>
<version>0.2</version>
</dependency>
添加到web.xml:
<filter>
<filter-name>loggingFilter</filter-name>
<filter-class>com.github.isrsal.logging.LoggingFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>loggingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
添加到log4j.xml:
<logger name="com.github.isrsal.logging.LoggingFilter">
<level value="DEBUG"/>
</logger>
答案 1 :(得分:3)
查看AbstractRequestLoggingFilter
系列过滤器。