2013-05-10 149 views
0

生成的日誌我有一個3用SpringMVC應用程序,它使用了Spring的安全,AOP,Hibernate等等減少應用程序用SpringMVC

但是,當我在Tomcat或碼頭運行它,它會產生一個巨大的日誌量。

如何減少此日誌?

我想要一個從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:[email protected]] 
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 
+0

這是使用的日誌框架log4j/logback – 2013-05-10 05:01:11

回答

1

如果使用的logback用於記錄則根記錄的日誌杆改爲警告,你可以找到在classpath

EX中logback.xml文件:

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

如果您使用的是log4j,則可以在您的類路徑中找到log4j.properties文件。將rootlogger級別更改爲WARNING

log4j.rootLogger=WARNING , A1 
相關問題