当前位置:首页 > 开发 > 编程语言 > 编程 > 正文

log4j

发表于: 2015-05-30   作者:香水浓   来源:转载   浏览:
摘要: log4j.rootCategory=DEBUG, STDOUT, DAILYFILE, HTML, DATABASE #log4j.rootCategory=DEBUG, STDOUT, DAILYFILE, ROLLINGFILE, HTML #console log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender log4
log4j.rootCategory=DEBUG, STDOUT, DAILYFILE, HTML, DATABASE
#log4j.rootCategory=DEBUG, STDOUT, DAILYFILE, ROLLINGFILE, HTML

#console
log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender
log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout
log4j.appender.STDOUT.layout.ConversionPattern=[[%d{yyyy MMM dd HH:mm:ss,SSS}] %p [%t] %l ]: %m%n

log4j.logger.com.troy.xmpl.log4j=INFO
log4j.logger.com.troy.xmpl.model=ERROR


#daily file
log4j.appender.DAILYFILE=org.apache.log4j.DailyRollingFileAppender  
log4j.appender.DAILYFILE.File=${log4j.log.DAILYFILE}
log4j.appender.DAILYFILE.layout=org.apache.log4j.PatternLayout  
1log4j.appender.DAILYFILE.layout.ConversionPattern=[[%d{yyyy MMM dd HH:mm:ss,SSS}] %p [%t] %l ]: %m%n


#html !! encoding issue exists
log4j.appender.HTML=org.apache.log4j.FileAppender
log4j.appender.HTML.File=${log4j.log.DAILYFILE.HTML}
log4j.appender.HTML.layout=org.apache.log4j.HTMLLayout
log4j.appender.HTML.layout.Title=${log4j.log.DAILYFILE.HTML.TITLE}
log4j.appender.HTML.layout.LocationInfo=true


#database !! encoding issue exists
log4j.appender.DATABASE=org.apache.log4j.jdbc.JDBCAppender 
log4j.appender.DATABASE.URL=${XMPL_DATABASE_URL}
log4j.appender.DATABASE.driver=${XMPL_DATABASE_DRIVER}
log4j.appender.DATABASE.user=${XMPL_DATABASE_USERNAME}
log4j.appender.DATABASE.password=${XMPL_DATABASE_PASSWORD}
log4j.appender.DATABASE.sql = INSERT INTO xmpl.secondary_xmpl_log_tbl (logDate,logTime,logThread,logLevel,logClass,logLogger,logMessage) values ('%d{yyyy-MM-dd}','%d{HH:mm:ss}','%t', '%p', '%c', '%l', '%m') 
log4j.appender.DATABASE.layout=org.apache.log4j.PatternLayout
log4j.appender.DATABASE.layout.ConversionPattern = %d{yyyy MM dd HH:mm:ss,SSS} %-5p %t %c %m

log4j

  • 0

    开心

    开心

  • 0

    板砖

    板砖

  • 0

    感动

    感动

  • 0

    有用

    有用

  • 0

    疑问

    疑问

  • 0

    难过

    难过

  • 0

    无聊

    无聊

  • 0

    震惊

    震惊

版权所有 IT知识库 CopyRight © 2009-2015 IT知识库 IT610.com , All Rights Reserved. 京ICP备09083238号