Line number not showing?

后端 未结 3 1470
耶瑟儿~
耶瑟儿~ 2021-01-18 17:39

I have discovered some issues in my program.
I was using log4j for logging,
however, inside the log file, all line number become \"?\".

The conversati

3条回答
  •  南笙
    南笙 (楼主)
    2021-01-18 18:35

    Check once. i am using your pattern i my code, and it works better....this is a log4j.properties file.

      log4j.rootLogger=DEBUG
    
      # AdminFileAppender - used to log messages in the admin.log file.
      log4j.appender.AdminFileAppender=org.apache.log4j.FileAppender
      log4j.appender.AdminFileAppender.File=admin.log
      log4j.appender.AdminFileAppender.layout=org.apache.log4j.PatternLayout
      log4j.appender.ReportFileAppender.layout.ConversionPattern=%d{dd/MM/yyyy HH:mm:ss,SSS} %5p %c: %L - %m%n
      #log4j.appender.AdminFileAppender.layout.ConversionPattern=%L - %r  %-5p %c %x - %m - %d - %t%n
    
      # ReportFileAppender - used to log messages in the report.log file.
      log4j.appender.ReportFileAppender=org.apache.log4j.FileAppender
      log4j.appender.ReportFileAppender.File=report.log
      log4j.appender.ReportFileAppender.layout=org.apache.log4j.PatternLayout
      log4j.appender.ReportFileAppender.layout.ConversionPattern=%d{dd/MM/yyyy HH:mm:ss,SSS} %5p %c: %L - %m%n
      #log4j.appender.ReportFileAppender.layout.ConversionPattern=%L  - %r  %-5p %c %x - %m - %d- %t%n
    
      log4j.logger.com.vaannila.admin=,AdminFileAppender 
      log4j.logger.com.vaannila.report=,ReportFileAppender
    

提交回复
热议问题