我在Log4j中遇到问题,就像在我的Maven Rest API项目中一样,我有如下的log4j.propeties文件。
# Root logger option
log4j.rootCategory= TRACE, stdout, file
# Each package has different appender name
log4j.logger.club.exbrain.hht.service.management=TRACE, club.exbrain.hht.service.management
# Direct log messages to stdout
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
# Direct log messages to a log file
log4j.appender.file=org.apache.log4j.RollingFileAppender
#Redirect to Tomcat logs folder
log4j.appender.file.File=${catalina.home}/logs/logging.log
log4j.appender.file.MaxFileSize=25MB
log4j.appender.file.MaxBackupIndex=10
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
问题是当我从Eclispe运行tomcat服务器时,我在tomcat logs文件夹中获取所有日志,但是当我导出war文件并将其部署到服务器时,我收到如下警告消息
log4j:WARN No appenders could be found for logger (org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap).
log4j:WARN Please initialize the log4j system properly.
请告诉我在哪里可以放置这个Log4j文件,或者是否有可能获取日志