.plugins.content.2.6.1.source-code.logback.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of content Show documentation
Show all versions of content Show documentation
A plugin used to manage contents like static pages, menus etc. at one place.
Also provides shortened and user friendly urls.
/*
* Copyright (c) 2016, CauseCode Technologies Pvt Ltd, India.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or
* without modification, are not permitted.
*/
import ch.qos.logback.classic.encoder.PatternLayoutEncoder
import grails.util.Environment
GString loggingPattern = "%d{HH:mm:ss.SSS} %-5level [${hostname}] %logger - %msg%n"
// For logging to console.
appender('STDOUT', ConsoleAppender) {
encoder(PatternLayoutEncoder) {
pattern = loggingPattern
}
}
def logfileDate = timestamp("yyyyMMdd'T'HHmmss")
GString logFilePath = "${System.properties['user.home']}/logs/causecode/${logfileDate}.log"
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)
}
}
logger('grails.app', DEBUG, ['STDOUT'], false)
logger('com.causecode', DEBUG, ['STDOUT'], false)
logger('com.causecode', INFO, ['STDOUT'])