在 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()]
}