日期:2014-05-19 浏览次数:20725 次
log4j.rootCategory=INFO, stdout , R log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.R=org.apache.log4j.RollingFileAppender log4j.appender.R.File=d\:/batchprocessdata/log.log #log4j.appender.R.DatePattern = '.'yyyy-MM-dd log4j.appender.R.Append=true log4j.appender.R.MaxFileSize=4MB log4j.appender.R.MaxBackupIndex=1000 log4j.appender.R.layout=org.apache.log4j.PatternLayout log4j.appender.R.layout.ConversionPattern=%d{yyyy-MM-dd } [%c]-[%p] %m%n log4j.logger.org.springframework=DEBUG log4j.logger.org.hibernate=DEBUG log4j.logger.org.hibernate.ps.PreparedStatementCache=DEBUG log4j.logger.com.myproject=DEBUG
import java.util.logging.Logger; import java.util.regex.Pattern; public class tt { private static final Logger LOG = Logger.getLogger(tt .class.getName()); public static void main(String[] args) { PropertyConfigurator.configure("log4j.properties"); LOG.info("sdfsdfasdf"); LOG.info("sdfsdfasdf"); } }