Grails - Log

在 Grails 中打印日志

  • 在 controller 和 service 中使用Log:

Demo

  • 在配置文件中配置相关,grails-app/conf/logback.groovy
def index(Integer max) {
    log.info("Test logging.")
    params.max = Math.min(max ?: 10, 100)
    respond dataDictService.list(params), model:[dataDictCount: dataDictService.count()]
}
posted @ 2020-05-12 14:41  duchaoqun  阅读(171)  评论(0编辑  收藏  举报