2017-03-08 5 views
0

内部のすべてのSpringbootログメッセージをlog4jに転送して、そのメッセージが私のlog4jプロパティに従うようにしたいのですが、無効です。springboot logging config無効

<dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter</artifactId> 
     <exclusions> 
      <exclusion> 
       <groupId>org.springframework.boot</groupId> 
       <artifactId>spring-boot-starter-logging</artifactId> 
      </exclusion> 
     </exclusions> 
    </dependency> 

    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-log4j</artifactId> 
     <version>1.3.8.RELEASE</version> 
    </dependency> 

logging.config =ファイルは:

が、それは

のlog4jを出力springbootを起動/data/log/report-log4j.properties:WARN logger(org.springframework.web.context.support.StandardServletEnvironment)のアペンダーは見つかりませんでした。 のlog4j:log4jのシステムを適切に

初期化しますが、クラスパスにreport-log4j.propertiesしてくださいをWARN、それは成功です

答えて

0

私はそれを解決しました。 spring-boot version1.4がlog4jをサポートしていないため

0

は、それはあなただけのlog4jを追加するのを忘れ、無効ではありません。プロパティー・ファイルをリソース・ディレクトリーに追加します。

それは通常、以下の内容があります。

# Root logger option 
log4j.rootLogger=INFO, stdout 

# Redirect log messages to console 
log4j.appender.stdout=org.apache.log4j.ConsoleAppender 
log4j.appender.stdout.Target=System.out 
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 
log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n 
+0

logging.config = file:/data/log/report-log4j.properties – senz

関連する問題