在Spring中配置使用commons-logging的simplelog来输出日志

来源:互联网 发布:java javascript 编辑:程序博客网 时间:2024/05/18 01:33

Spring中使用自带的commons-logging的simplelog来输出日志。

要在spring中使用simplelog输出日志,需要在classpath中放入两个properties:commons-logging.properties和simplelog.properties

commons-logging.properties:

org.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog

simplelog.properties:

#Set to true if you want the Log instance name to be included in output messages. Defaults to false.org.apache.commons.logging.simplelog.showlogname=true#Set to true if you want the last component of the name to be included in output messages. Defaults to true.#org.apache.commons.logging.simplelog.showShortLogname=false#Set to true if you want the current date and time to be included in output messages. Default is false.org.apache.commons.logging.simplelog.showdatetime=true#The date and time format to be used in the output messages. The pattern describing the date and time format is the same that is used in java.text.SimpleDateFormat. If the format is not specified or is invalid, the default format is used. The default format is yyyy/MM/dd HH:mm:ss:SSS zzz.#org.apache.commons.logging.simplelog.dateTimeFormat=yyyy/MM/dd HH:mm:ss:SSS zzz#Default logging detail level for all instances of SimpleLog. Must be one of: trace debug info warn error fatal If not specified, defaults to info.#org.apache.commons.logging.simplelog.defaultlog=debug## Configure logging levelsorg.apache.commons.logging.simplelog.log.org.springframework.jdbc=trace


0 0
原创粉丝点击