开发者社区> 问答> 正文

Log4j报错问题

Error:
`log4j:ERROR Could not find value for key log4j.appender.FILE.layout
log4j:ERROR No layout set for the appender named [FILE].`
配置:

 # Define the root logger with appender file
log = D://WorkSpace/logs/
log4j.rootLogger = debug, FILE
# Define the file appender
log4j.appender.FILE=org.apache.log4j.FileAppender
log4j.appender.FILE.File=${log}log.out
Log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
Log4j.appender.FILE.layout.ConversionPattern=%t-%x-%-5p-%-10c:%m%n

展开
收起
蛮大人123 2016-05-26 17:49:22 4572 0
1 条回答
写回答
取消 提交回答
  • 我说我不帅他们就打我,还说我虚伪
    log4j.rootLogger=DEBUG,Console,Stdout  
    
    #Console  
    log4j.appender.Console=org.apache.log4j.ConsoleAppender  
    log4j.appender.Console.layout=org.apache.log4j.PatternLayout  
    log4j.appender.Console.layout.ConversionPattern=%d [%t] %-5p [%c] - %m%n  
    
    log4j.logger.java.sql.ResultSet=INFO  
    log4j.logger.org.apache=INFO  
    log4j.logger.java.sql.Connection=DEBUG  
    log4j.logger.java.sql.Statement=DEBUG  
    log4j.logger.java.sql.PreparedStatement=DEBUG   
    
    log4j.appender.Stdout = org.apache.log4j.DailyRollingFileAppender    
    log4j.appender.Stdout.File = E://logs/log.log    
    log4j.appender.Stdout.Append = true    
    log4j.appender.Stdout.Threshold = DEBUG     
    log4j.appender.Stdout.layout = org.apache.log4j.PatternLayout    
    log4j.appender.Stdout.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss}  [ %t:%r ] - [ %p ]  %m%n   
    2019-07-17 19:16:42
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载