Log4j如何停止记录仪将数据打印到控制台?

时间:2019-01-25 07:12:52

标签: java logging log4j

#log4j.rootLogger=DEBUG, fileAppender

# Root logger
log4j.rootLogger=INFO, file

# Direct log messages to a log file
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=D:\\BIMPaaSAutomationFramework\\log\\Log_${log4j.now}_logfile.log
log4j.appender.file.MaxFileSize=2MB
log4j.appender.file.MaxBackupIndex=10
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d %-5p [%c{1}] - %m %n

log4j.logger.org.apache=ERROR
log4j.logger.httpclient=ERROR
log4j.logger.httpclient.wire=ERROR


log4j.logger.org.apache.log4j.PropertyConfigurator=INFO
log4j.logger.org.apache.log4j.config.PropertySetter=INFO
log4j.logger.org.apache.log4j.FileAppender=INFO

下面是我的log4j.properties文件,我需要停止将数据打印到控制台,因为它正在控制台和文件上打印,但是我只需要在文件中而不是在控制台上打印

0 个答案:

没有答案