Created
April 20, 2016 00:48
-
-
Save slackboxster/8ed07fa21bdb5355bf04752e10f4b73e to your computer and use it in GitHub Desktop.
Various versions of logback.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This one logs errors in Bootstrap.groovy into the stacktrace.log | |
* Note the absence of a StackTrace logger. | |
* / | |
import grails.util.BuildSettings | |
import grails.util.Environment | |
// See http://logback.qos.ch/manual/groovy.html for details on configuration | |
appender('STDOUT', ConsoleAppender) { | |
encoder(PatternLayoutEncoder) { | |
pattern = "%level %logger - %msg%n" | |
} | |
} | |
root(ERROR, ['STDOUT']) | |
appender("FULL_STACKTRACE", FileAppender) { | |
file = "build/stacktrace.log" | |
append = true | |
encoder(PatternLayoutEncoder) { | |
pattern = "%level %logger - %msg%n" | |
} | |
} | |
logger("grails.app.init.BootStrap", ERROR, ['FULL_STACKTRACE'], false) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This one doesn't log into the stacktrace.log | |
* This is expected behavior. | |
* / | |
import grails.util.BuildSettings | |
import grails.util.Environment | |
// See http://logback.qos.ch/manual/groovy.html for details on configuration | |
appender('STDOUT', ConsoleAppender) { | |
encoder(PatternLayoutEncoder) { | |
pattern = "%level %logger - %msg%n" | |
} | |
} | |
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This one logs into the stacktrace.log for any error. | |
* Note the absence of the StackTrace logger. | |
* / | |
import grails.util.BuildSettings | |
import grails.util.Environment | |
// See http://logback.qos.ch/manual/groovy.html for details on configuration | |
appender('STDOUT', ConsoleAppender) { | |
encoder(PatternLayoutEncoder) { | |
pattern = "%level %logger - %msg%n" | |
} | |
} | |
appender("FULL_STACKTRACE", FileAppender) { | |
file = "build/stacktrace.log" | |
append = true | |
encoder(PatternLayoutEncoder) { | |
pattern = "%level %logger - %msg%n" | |
} | |
} | |
root(ERROR, ['STDOUT', 'FULL_STACKTRACE']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
gist for this question: http://stackoverflow.com/questions/36723285/why-does-stacktrace-log-not-fill-with-logback-in-grails-3