0

我有一个使用 Spring Security、AOP、HIbernate 等的 SpringMVC 3 应用程序。

但是当我在 Tomcat 或 Jetty 中运行它时,它会生成大量日志。

我怎样才能减少这个日志?

我想要一个从WARNING.

日志示例:

21:16:08.393 [qtp12506312-25] DEBUG o.s.s.w.s.HttpSessionEventPublisher - Publishing event: org.springframework.security.web.session.HttpSessi onCreatedEvent[source=org.eclipse.jetty.server.session.HashedSess ion:db7nzoxke45es1k02gbug79d@6784961]
21:16:08.394 [qtp12506312-25] DEBUG o.s.s.w.s.HttpSessionRequestCache - DefaultSavedRequest added to Session: DefaultSavedRequest[http://xx.xx.xx.xx:8080/favicon.ico]
21:16:08.394 [qtp12506312-25] DEBUG o.s.s.w.a.ExceptionTranslationFilter - Calling Authentication entry point.
21:16:08.440 [qtp12506312-25] DEBUG o.s.s.web.DefaultRedirectStrategy - Redirecting to 'http://xx.xx.xx.xx:8080/default;jsessionid=db7nzoxke45es1k02gbug79d'
21:16:08.441 [qtp12506312-25] DEBUG o.s.s.w.c.HttpSessionSecurityContextRepository - SecurityContext is empty or contents are anonymous - context will not be stored in HttpSession.
21:16:08.441 [qtp12506312-25] DEBUG o.s.s.w.c.SecurityContextPersistenceFilter - SecurityContextHolder now cleared, as request processing completed
21:16:08.518 [qtp12506312-26] DEBUG o.s.s.web.util.AntPathRequestMatcher - Checking match of request : '/default'; against '/loginform.jsp'
21:16:08.518 [qtp12506312-26] DEBUG o.s.s.web.util.AntPathRequestMatcher - Checking match of request : '/default'; against '/loginform2.jsp'
21:16:08.518 [qtp12506312-26] DEBUG o.s.s.web.util.AntPathRequestMatcher - Checking match of request : '/default'; against '/default'
21:16:08.518 [qtp12506312-26] DEBUG o.s.security.web.FilterChainProxy - /default has an empty filter list
4

1 回答 1

1

如果您使用 logback 进行日志记录,则将根记录器的日志控制杆更改为 WARNING,您可以在类路径中找到 logback.xml 文件

前任:

<root level="WARN">
    <appender-ref ref="STDOUT" />
    <appender-ref ref="FILE" />
</root>

如果您使用的是 log4j,您可以在类路径中找到 log4j.properties 文件。再次将 rootlogger 级别更改为 WARNING

log4j.rootLogger=WARNING , A1
于 2013-05-10T05:05:55.530 回答