1

Migrated grails2 to grails3. In grails2 i used lots of
log.info,log.debug statements in side
src/main/groovy files. but in grails-3 by default
log is not injected.
it's giving error like No such property: log for class

lepe
  • 24,677
  • 9
  • 99
  • 108
naresh
  • 155
  • 1
  • 11

1 Answers1

2

This is a planned change. You can use @groovy.util.logging.Commons annotations on your non-grails classes to have log available. Also other like @Log4j, @Slf4j are available, depending on your logging library.

There is one more difference which is important - those annotations will add log as private property and classes which will inherit from them, will also need to be annotated to use logging. Alternative is to manually define protected logger on your class.

practical programmer
  • 1,604
  • 10
  • 15