0

サーブレット コンテナーに Tomcat を使用しています。毎日デバッグするために catalina.out ログを確認する必要があります。しかし、匿名ユーザーがログインしようとすると、Spring Security インターセプターが例外をスローし、catalina.out ログファイルをあふれさせます。このようなログ:

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.springframework.security.authentication.AuthenticationCredentialsNotFoundException: An Authentication object was not found in the SecurityContext
at org.springframework.security.access.intercept.AbstractSecurityInterceptor.credentialsNotFound(AbstractSecurityInterceptor.java:327)
at org.springframework.security.access.intercept.AbstractSecurityInterceptor.beforeInvocation(AbstractSecurityInterceptor.java:197)
at org.springframework.flex.security3.EndpointInterceptor.preProcess(EndpointInterceptor.java:97)
at org.springframework.flex.core.MessageInterceptionAdvice.invoke(MessageInterceptionAdvice.java:62)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.adapter.ThrowsAdviceInterceptor.invoke(ThrowsAdviceInterceptor.java:124)
... 52 more

Tomcat で Spring Security ロギングを無効にするには?

4

1 に答える 1

4

ログ レベルが DEBUG に設定されていて、フィルター チェーンに AnonymousAuthenticationFilter がない場合、ログに AuthenticationCredentialsNotFoundException が表示されます。

FAQを参照してください。

したがって、名前空間構成ではなく、セキュリティ アプリケーション コンテキストで従来の Bean 構成を使用していると想定しています。例外を取り除きたい場合は、ドキュメントで説明されているように、アプリケーション コンテキストに anonymousAuthenticationFilter を追加できます。

または、ログレベルを変更することもできます

org.springframework.security.level=INFO

この質問で述べたようにTomcatで。

于 2012-07-31T06:16:39.920 に答える