I'm migrating an app frm Grails 2.5.6 to Grails 3.3.9 and I'm having trouble making the logs from the Bootstrap.groovy work, I need to do a log.info "xxxx" for stuff that gets created in the init, but can't find one single example online about how that is done.
Asked
Active
Viewed 190 times
0
-
1Have you tried adding `logger("my.package.BootStrap", INFO)` to your `logback.groovy`? – cfrick Apr 16 '19 at 06:19
-
It worked! so simple, sad it is not documented anywhere. – Pablo Pazos Apr 16 '19 at 17:01
-
Logbacks groovy config is quite well documented https://logback.qos.ch/manual/groovy.html – erichelgeson Apr 17 '19 at 00:56
-
logback is well documented, not how Grails uses it, this is about Grails not logback. – Pablo Pazos Apr 17 '19 at 05:22
1 Answers
0
The Bootstrap
is just a regular class. So it can be handled like any other class for logging purposes. Add a logger in your logback.groovy
:
logger("my.package.BootStrap", INFO) // adjust package

cfrick
- 35,203
- 6
- 56
- 68