Seven Languages in Seven Weeks

You should learn a programming language every year, as recommended by The Pragmatic Programmer. But if one per year is good, how about Seven Languages in Seven Weeks?
Ruby, Io, Prolog, Scala, Erlang, Clojure, Haskell. Prapare to study week by week

记录下log4j的文件滚动格式

log4j 可以根据日志的大小按月,周,半天,天,小时,分钟滚动进行日志配置。基本的样式如下:
# log4j.appender.fileout=org.apache.log4j.DailyRollingFileAppender
# log4j.appender.fileout.File=./logs/programdolt.log
##log4j.appender.fileout.DatePattern='.'yyyy-MM-dd
# log4j.appender.fileout.DatePattern='.'yyyy-MM-dd-HH-mm

其中log4j.appender.fileout.DatePattern 就是要配置的日志格式。其中DailyRollingFileAppender 继承自FileAppender ,所以可以根据用户的选择进行日志的滚动。常用的格式如下:

'.'yyyy-MM ##每月滚动一次,/foo/bar.log will be copied to /foo/bar.log.2010-08
'.'yyyy-ww ##每周滚动一次,其中每周的第一天跟时区设置有关,/foo/bar.log will be copied to /foo/bar.log.2010-23
'.'yyyy-MM-dd ##每天滚动一次,/foo/bar.log will be copied to /foo/bar.log.2010-08-08
'.'yyyy-MM-dd-a ##每半天滚动一次,/foo/bar.log will be copied to /foo/bar.log.2010-08-09-AM
'.'yyyy-MM-dd-HH ##每小时滚动一次./foo/bar.log will be copied to /foo/bar.log.2010-08-09-10
'.'yyyy-MM-dd-HH-mm ##每分钟滚动一次./foo/bar.log will be copied to /foo/bar.log.2010-08-09-10-22