sfell77
sfell77

Reputation: 986

Grails 3 - no production logs

I've seen some other posts about this but no solutions yet; I've never had an issue with NO LOGS in earlier versions of Grails so this is highly annoying as I'm trying to trouble-shoot why my app works as expected in QA but not in production.

There are no logs created by the application in the tomcat container; not a one.

I have catalina.date files for actual tomcat processes but NOTHING for the app, which I feel in earlier Grails versions was included here or stdout. Anyone have a solution for this?

This is Grails 3, FYI

Upvotes: 1

Views: 312

Answers (1)

sfell77
sfell77

Reputation: 986

In [grails-app/conf/logback.groovy] there is a method to build logs however it is confined to development mode. Comment out the conditional tags (if ..) and re-build/deploy. Logs will show up @ the path specified in the method, in my case, stacktrace.log:

def targetDir = BuildSettings.TARGET_DIR
//if (Environment.isDevelopmentMode() && targetDir) {
    appender("FULL_STACKTRACE", FileAppender) {
        file = "${targetDir}/stacktrace.log"
        append = true
        encoder(PatternLayoutEncoder) {
            pattern = "%level %logger - %msg%n"
        }
    }
    logger("StackTrace", ERROR, ['FULL_STACKTRACE'], false)
//}

Upvotes: 2

Related Questions