Configuring Logging for Grails Standalone App Runner

。_饼干妹妹 提交于 2019-12-11 16:08:39

问题


I am writing a Grails app and would like to use the Grails Standalone App Runner that packages your Grails app into a fat JAR with an embedded Tomcat container.

I would like to configure logging for the embedded Tomcat container will use to store and read SSL certs from. I want to specify log levels for different catalina components, and also replace log4j with logback using SyslogAppender.

How/where do I make such configurations? Is this documented anywhere?


回答1:


If you want to replace log4j with logback, you can use Logback Plugin.

You need to add following lines in your BuildConfig.groovy.

dependencies {
   compile 'org.grails.plugins:logback:0.3.1'
}

You also need to exclude grails log4j plugin.

inherits('global') {
   excludes 'grails-plugin-log4j', 'log4j'
}

You also need to run

grails clean

to remove compiled files.

You can find more about the plugin here.



来源:https://stackoverflow.com/questions/26313765/configuring-logging-for-grails-standalone-app-runner

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!