grailslogbackgrails-3.3

How can logback be configured to log at INFO level from Bootstrap on Grails 3.x?


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.


Solution

  • 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