配置Grails的日志记录独立应用程序运行器 [英] Configuring Logging for Grails Standalone App Runner
问题描述
我正在撰写一个Grails应用程式,并想使用 Grails独立应用程式跑步器来封装您的Grails app嵌入到具有嵌入式Tomcat容器的胖JAR中。
我想为嵌入式Tomcat容器配置日志记录,用于存储和读取SSL证书。我想为不同catalina组件指定日志级别,并使用 SyslogAppender
替换log4j和logback。
如何/在哪里做这样的配置?
如果要使用logback替换log4j,可以使用 Logback Plugin 。
您需要在BuildConfig中添加以下行.groovy。
依赖项{
compile'org.grails.plugins:logback:0.3.1'
}
您还需要排除grails log4j插件。
inherits('global'){
excludes'grails-plugin-log4j','log4j'
}
您还需要运行
grails clean
删除已编译的文件。
您可以在此处找到有关插件的更多信息。
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?
解决方案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.
这篇关于配置Grails的日志记录独立应用程序运行器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!