我想为所有错误,sysout,warn等创建一个日志文件,但我得到了单独的日志文件。我想要一个日志文件,我可以一次看到所有细节/
这是我的XML。
<log-config>
<log4j-config-properties>
<property>
<key>log4j.rootCategory</key>
<value>WARN, stdout,info,debug</value> <!--set log level and add appenders i.e DEBUG, INFO, A1, stdout -->
</property>
<property>
<key>log4j.appender.stdout</key>
<value>org.apache.log4j.ConsoleAppender</value>
</property>
<property>
<key>log4j.appender.stdout.layout</key>
<value>org.apache.log4j.PatternLayout</value>
</property>
<property>
<key>log4j.appender.stdout.layout.ConversionPattern</key>
<value>Project %d{ISO8601} %-5p %x %c{2} %m%n</value>
</property>
<property>
<key>log4j.appender.A1</key>
<value>org.apache.log4j.RollingFileAppender</value>
</property>
<property>
<key>log4j.appender.A1.File</key>
<value>logs/Project.log</value>
</property>
<property>
<key>log4j.appender.A1.MaxBackupIndex</key>
<value>5</value>
</property>
<property>
<key>log4j.appender.A1.layout</key>
<value>org.apache.log4j.PatternLayout</value>
</property>
<property>
<key>log4j.appender.A1.layout.ConversionPattern</key>
<value>Project %d{ISO8601} %-5p %x %c{2} %m%n</value>
</property>
<property>
<key>log4j.category.org.apache</key>
<value>WARN</value>
</property>
<property>
<key>log4j.category.dao_timer</key>
<value>WARN</value>
</property>
<property>
<key>log4j.category.dao_sql</key>
<value>WARN</value>
</property>
<property>
<key>log4j.category.web_timer</key>
<value>WARN</value>
</property>
<property>
<key>log4j.category.webTierPerformance</key>
<value>ERROR,stdout</value>
</property>
<property>
<key>log4j.category.webTierPerformance.appender.stdout.layout.ConversionPattern</key>
<value>Project %d{ISO8601} %-5p %x %c{2} %m%n</value>
</property>
</log4j-config-properties>
文件夹日志没有任何日志文件。我想要一个名为Project.log的单个日志文件。提前致谢