3

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

Shashank Agrawal
  • 25,161
  • 11
  • 89
  • 121
matt_roo
  • 415
  • 3
  • 14

1 Answers1

2

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

Shashank Agrawal
  • 25,161
  • 11
  • 89
  • 121
matt_roo
  • 415
  • 3
  • 14