All Downloads are FREE. Search and download functionalities are using the official Maven repository.

.plugins.nucleus.1.1.0.source-code.logback.groovy Maven / Gradle / Ivy

import ch.qos.logback.classic.encoder.PatternLayoutEncoder
import grails.util.Environment

def dateFormat = "yyyy-MM-dd'T'HHmmss"
GString loggingPattern = "%d{${dateFormat}} %-5level [${hostname}] %logger - %msg%n"

// For logging to console.
appender('STDOUT', ConsoleAppender) {
    encoder(PatternLayoutEncoder) {
        pattern = loggingPattern
    }
}

if (Environment.current in [Environment.DEVELOPMENT, Environment.TEST]) {
    // Enable Spring Framework logs by passing the argument like 'grails -Dspring.logs=1 run-app'.
    if (System.properties['spring.logs'] == '1') {
        logger('org.springframework', DEBUG, ['STDOUT'], false)
    }

    if (System.properties['sql.logs'] == '1') {
        logger('org.hibernate', DEBUG, ['STDOUT'], false)
    }
}

root(ERROR, ['STDOUT'])
logger('com.causecode', DEBUG, ['STDOUT'], false)
logger('grails.app', DEBUG, ['STDOUT'], false)
logger('StackTrace', ERROR, ['STDOUT'], false)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy