#============================================================Logger CommonLog
log4j.logger.CommonLog=DEBUG, Console, LogRollingFile
# Console output...
log4j.appender.Console=org.apache.log4j.ConsoleAppender
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
log4j.appender.Console.layout.ConversionPattern=[%-5p] %d{yyyy-MM-dd HH:mm:ss,SSS} method:%l%n%m%n
# RollingFileAppender output...
log4j.appender.LogRollingFile=org.apache.log4j.RollingFileAppender
log4j.appender.LogRollingFile.File=${user.dir}/yccb/log/yccb.log
log4j.appender.LogRollingFile.Append=true
log4j.appender.LogRollingFile.MaxFileSize=46MB
log4j.appender.LogRollingFile.MaxBackupIndex=50
log4j.appender.LogRollingFile.layout=org.apache.log4j.PatternLayout
log4j.appender.LogRollingFile.layout.ConversionPattern=[%-5p] %d{yyyy-MM-dd HH\:mm\:ss,SSS} method\:%l%n%m%n
#============================================================Logger SkmLog
log4j.logger.SkmLog=DEBUG, DailyRollingFile
# DailyRollingFile output...
log4j.appender.DailyRollingFile=org.apache.log4j.DailyRollingFileAppender
log4j.appender.DailyRollingFile.DatePattern=yyyy-MM-dd'.log'
log4j.appender.DailyRollingFile.File=${user.dir}/yccb/log/skm/skm.log
log4j.appender.DailyRollingFile.layout=org.apache.log4j.PatternLayout
log4j.appender.DailyRollingFile.layout.ConversionPattern=[%-5p] %d{yyyy-MM-dd HH\:mm\:ss,SSS} method\:%l%n%m%n
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
sdf.setLenient(false);
boolean b = true;
try {
sdf.parse("2002-15-11");
} catch (ParseException e) {
e.printStackTrace();
b = false;
}
System.out.println(b);
http://blog.csdn.net/wuxianglong/article/details/6285978