码迷,mamicode.com
首页 > Web开发 > 详细

web项目的日志打印位置设置

时间:2016-05-16 14:21:22      阅读:336      评论:0      收藏:0      [点我收藏+]

标签:

1, 若在项目中放logback.groovy文件(如: src/test/resource下),则日志会打印到控制台上. 

logback.groovy 内容如下:

//
// Built on Fri Feb 14 07:38:28 CET 2014 by logback-translator
// For more information on configuration files in Groovy
// please see http://logback.qos.ch/manual/groovy.html

// For assistance related to this tool or configuration files
// in general, please contact the logback user mailing list at
//    http://qos.ch/mailman/listinfo/logback-user

// For professional support please see
//   http://www.qos.ch/shop/products/professionalSupport

import ch.qos.logback.classic.encoder.PatternLayoutEncoder
import ch.qos.logback.core.ConsoleAppender

import static ch.qos.logback.classic.Level.DEBUG
import static ch.qos.logback.classic.Level.INFO

appender("stdout", ConsoleAppender) {
  encoder(PatternLayoutEncoder) {
    pattern = "%d{YYYY-MM-dd HH:mm:ss} [%level] %logger{50} -> %X{rpid} %msg %n%ex"
  }
}
root(INFO, ["stdout"])
logger("com.travelzen", DEBUG)
logger("com.ibatis", DEBUG)
logger("java.sql.Connection", DEBUG)
logger("java.sql.Statement", DEBUG)
logger("java.sql.PreparedStatement", DEBUG)
logger("java.sql.ResultSet", DEBUG)

logger("org.perf4j.TimingLogger", DEBUG, ["stdout"], false)

 

若没有这个文件, 则会打印在/data/log/下

 

web项目的日志打印位置设置

标签:

原文地址:http://www.cnblogs.com/wodo2008/p/5497715.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!