Log4j日志文件输出为相对路径的解决方法
方法一:将日志文件输出到tomcat自身的日志文件夹logs中
?
# Set root category priority to info and its only appender to console. log4j.rootCategory=info,console,R#log4j.debug=true# console is set to be a ConsoleAppender using a PatternLayout. log4j.appender.console=org.apache.log4j.ConsoleAppender log4j.appender.console.Threshold=info log4j.appender.console.layout=org.apache.log4j.PatternLayout log4j.appender.console.layout.ConversionPattern=- %m%n# R is set to be a File appender using a PatternLayout.log4j.appender.R=org.apache.log4j.RollingFileAppenderlog4j.appender.R.Append=truelog4j.appender.R.Threshold=info log4j.appender.R.MaxFileSize=1024KB log4j.appender.R.MaxBackupIndex=10log4j.appender.R.File=abc.loglog4j.appender.R.layout=org.apache.log4j.PatternLayoutlog4j.appender.R.layout.ConversionPattern=%-d{yyyy-MM-dd HH\:mm\:ss} [%c]-[%p] %m%n
?
?
?