スプリングアプリケーションでデバッグモードを無効にする方法。私が本番環境でアプリケーションを実行すると、多くのデバッグログステートメントが提供され、Tomcatのログファイルはディスク内でより多くの領域を占有します。以下のように、ここでスプリングのデバッグログを無効にする方法
05:03:26.340 [http-bio-1880-exec-2] DEBUG o.s.s.w.a.ExceptionTranslationFilter - Chain processed normally
05:03:26.340 [http-bio-1880-exec-2] DEBUG o.s.s.w.c.SecurityContextPersistenceFilter - SecurityContextHolder now cleared, as request processing completed
05:03:30.118 [http-bio-1880-exec-2] DEBUG o.s.s.w.u.m.AntPathRequestMatcher - Checking match of request : '/myRestCall/1234'; against '/'
05:03:30.118 [http-bio-1880-exec-2] DEBUG o.s.security.web.FilterChainProxy - /myRestCall/1234 at position 1 of 8 in additional filter chain; firing Filter: 'SecurityContextPersistenceFilter'
05:03:30.118 [http-bio-1880-exec-2] DEBUG o.s.s.w.c.HttpSessionSecurityContextRepository - No HttpSession currently exists
05:03:30.118 [http-bio-1880-exec-2] DEBUG o.s.s.w.c.HttpSessionSecurityContextRepository - No SecurityContext was available from the HttpSession: null. A new one will be created.
05:03:30.118 [http-bio-1880-exec-2] DEBUG o.s.security.web.FilterChainProxy - /myRestCall/1234 at position 2 of 8 in additional filter chain; firing Filter: 'WebAsyncManagerIntegrationFilter'
05:03:30.118 [http-bio-1880-exec-2] DEBUG o.s.security.web.FilterChainProxy - /myRestCall/1234 at position 3 of 8 in additional filter chain; firing Filter: 'CustomUserNamePasswordAuthenticationFilter'
05:03:30.118 [http-bio-1880-exec-2] DEBUG o.s.security.web.FilterChainProxy - /myRestCall/1234 at position 4 of 8 in additional filter chain; firing Filter: 'RequestCacheAwareFilter'
05:03:30.118 [http-bio-1880-exec-2] DEBUG o.s.security.web.FilterChainProxy - /myRestCall/1234 at position 5 of 8 in additional filter chain; firing Filter: 'SecurityContextHolderAwareRequestFilter'
05:03:30.118 [http-bio-1880-exec-2] DEBUG o.s.security.web.FilterChainProxy - /myRestCall/1234 at position 6 of 8 in additional filter chain; firing Filter: 'SessionManagementFilter'
05:03:30.118 [http-bio-1880-exec-2] DEBUG o.s.security.web.FilterChainProxy - /myRestCall/1234 at position 7 of 8 in additional filter chain; firing Filter: 'ExceptionTranslationFilter'
05:03:30.118 [http-bio-1880-exec-2] DEBUG o.s.security.web.FilterChainProxy - /myRestCall/1234 at position 8 of 8 in additional filter chain; firing Filter: 'FilterSecurityInterceptor'
05:03:30.118 [http-bio-1880-exec-2] DEBUG o.s.s.w.a.i.FilterSecurityInterceptor - Public object - authentication not attempted
05:03:30.118 [http-bio-1880-exec-2] DEBUG o.s.security.web.FilterChainProxy - /myRestCall/1234 reached end of additional filter chain; proceeding with original
は、すべてのデバッグログを無効にする方法私のdepedency
<!-- logging into console -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>1.7.5</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>1.0.13</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.0.13</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>log4j-over-slf4j</artifactId>
<version>1.7.5</version>
</dependency>
であると私は警告と例外ログを表示したいです。その結果に基づいて
は私がlogback.xml(SRC /メイン/リソース/設定/ logback.xml)以下のようなファイル、
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<!-- encoders are assigned the type
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<logger name="org.springframework" level="ERROR"/>
<root level="ERROR">
<appender-ref ref="STDOUT" />
</root>
</configuration>
を作成した。しかしそれでもDEBUGは、コンソールでの印刷を記録します。どこで私は間違いをしていますか?
何を試しましたか? log4j設定のように見える –
あなたはlog4jをslf4jブリッジに使用しているようです。 log4j/logback/JULの実際のログフレームワークとは何ですか?あなたのログフレームワークの設定ファイルを投稿してください。 –
@ekemchitsiga plsは更新された質問を参照してください。 – MMMMS