首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 开源软件 >

logback groovy配备

2013-07-04 
logback groovy配置def log_home System.getProperty(LOG_HOME)def log_file xxlogdef level

logback groovy配置

def log_home = System.getProperty("LOG_HOME");def log_file = "xxlog";def level = DEBUG;if(log_home == null){if("Windows" == os){log_home = "d:/logs";}else{log_home = "/home/web/logs";}}println "log home ==> ${log_home}"println "log level ==> ${level}"appender("FILE", RollingFileAppender) {  append = true;  encoder(PatternLayoutEncoder) {    pattern = "%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{80} - %msg%n"  }  rollingPolicy(TimeBasedRollingPolicy){  maxHistory = 30;  fileNamePattern = "${log_home}/${log_file}.%d{yyyy-MM-dd}.log";  }  triggeringPolicy(SizeBasedTriggeringPolicy){  maxFileSize = "50mb";  }}appender("STDOUT", ConsoleAppender) {  encoder(PatternLayoutEncoder) {pattern = "%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{80} - %msg%n"  }}logger("com.xxx", DEBUG)logger("org.springframework", INFO)root(DEBUG, ["STDOUT","FILE"])

热点排行