赞
踩
Flink本地运行时需配置slf4j日志,生成日志文件或在控制台直接输出日志
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.21</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.21</version>
</dependency>
#log4j.rootLogger=INFO,console,dailyFile,rollingFile,logFile log4j.rootLogger=INFO,console,dailyFile log4j.additivity.org.apache=true # 控制台(console) log4j.appender.console=org.apache.log4j.ConsoleAppender log4j.appender.console.Threshold=DEBUG log4j.appender.console.ImmediateFlush=true log4j.appender.console.Target=System.err log4j.appender.console.layout=org.apache.log4j.PatternLayout log4j.appender.console.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} [%p] %m%n ## 日志文件(logFile) #log4j.appender.logFile=org.apache.log4j.FileAppender #log4j.appender.logFile.Threshold=DEBUG #log4j.appender.logFile.ImmediateFlush=true #log4j.appender.logFile.Append=true #log4j.appender.logFile.File=D:/logs/log.log4j #log4j.appender.logFile.layout=org.apache.log4j.PatternLayout #log4j.appender.logFile.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} [%p] %m%n ## 滚动文件(rollingFile) #log4j.appender.rollingFile=org.apache.log4j.RollingFileAppender #log4j.appender.rollingFile.Threshold=DEBUG #log4j.appender.rollingFile.ImmediateFlush=true #log4j.appender.rollingFile.Append=true #log4j.appender.rollingFile.File=D:/logs/log.log4j #log4j.appender.rollingFile.MaxFileSize=200KB #log4j.appender.rollingFile.MaxBackupIndex=50 #log4j.appender.rollingFile.layout=org.apache.log4j.PatternLayout #log4j.appender.rollingFile.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} [%p] %m%n # 定期滚动日志文件(dailyFile) #log4j.appender.dailyFile=org.apache.log4j.DailyRollingFileAppender #log4j.appender.dailyFile.Threshold=INFO #log4j.appender.dailyFile.ImmediateFlush=true #log4j.appender.dailyFile.Append=true #log4j.appender.dailyFile.File=D:\\Program Files (x86)\\WorkspaceIDEA\\FlinkStu\\flink.log #log4j.appender.dailyFile.DatePattern='.'yyyy-MM-dd #log4j.appender.dailyFile.layout=org.apache.log4j.PatternLayout #log4j.appender.dailyFile.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} [%p] %m%n
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。