Grails 3: External Logback.groovy file

纵然是瞬间 提交于 2020-01-04 03:54:14

问题


I'm trying to externalize my logback.groovy file by setting the path in my build.gradle file in the bootrun closure:

bootRun {
    if (Environment.currentEnvironment == Environment.PRODUCTION) {
        jvmArgs = ['-XX:MaxPermSize=2g', '-Xmx2g', '-Dlogging.config=/path/to/config/logback.groovy']
    } else {
        jvmArgs = ['-XX:MaxPermSize=2g', '-Xmx2g']
    }
}

But I am getting:

.logback.classic.LoggerContext[default] - Found resource [logback.groovy] at [file:/Users/name/workspace/project/build/resources/main/logback.groovy]

It keeps reading from the classpath and not from the external file... Any help appreciated, thanks


回答1:


I fixed the issue by adding -Dlogging.config=/path/to/config/logback.groovy as a system property in tomcat.



来源:https://stackoverflow.com/questions/38853935/grails-3-external-logback-groovy-file

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