logback-groovy

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

Why does stacktrace.log not fill with logback in grails 3?

扶醉桌前 提交于 2019-12-14 04:16:24
问题 When you create a new grails application, the default logback.groovy file (and almost every example of a logback.groovy, even Mr Haki's example) contains the following code, which I have simplified to focus on the relevant piece: root(ERROR, ['STDOUT']) appender("FULL_STACKTRACE", FileAppender) { file = "build/stacktrace.log" append = true encoder(PatternLayoutEncoder) { pattern = "%level %logger - %msg%n" } } logger("StackTrace", ERROR, ['FULL_STACKTRACE'], false ) However, following this

logback how to set destination folder for log files

做~自己de王妃 提交于 2019-12-07 01:31:01
问题 Is there a way to set a single destination folder, such that I can specify where all log files should be created rather than having to set it on an appender by appender basis? 回答1: You can define a property in the logback configuration file an use it as below <configuration> <property name="USER_HOME" value="/home/sebastien" /> <appender name="SPRING_LOGS" class="ch.qos.logback.core.FileAppender"> <file>${USER_HOME}/spring.log</file> <encoder> <pattern>%msg%n</pattern> </encoder> </appender>