4.1.3.1 Logger Names
Version: 4.0.11
4.1.3.1 Logger Names
Grails artifacts (controllers, services …) get injected a log
property automatically.
Prior to Grails 3.3.0, the name of the
logger for Grails Artifact followed the convention grails.app.<type>.<className>
, where type is the
type of the artifact, for example, controllers
or services
, and className
is the fully
qualified name of the artifact.
Grails 3.3.x simplifies logger names. The next examples illustrate the changes:
BookController.groovy
located at grails-app/controllers/com/company
NOT annotated with @Slf4j
Logger Name (Grails 3.3.x or higher) |
Logger Name (Grails 3.2.x or lower) |
|
|
BookController.groovy
located at grails-app/controllers/com/company
annotated with @Slf4j
Logger Name (Grails 3.3.x or higher) |
Logger Name (Grails 3.2.x or lower) |
|
|
BookService.groovy
located at grails-app/services/com/company
NOT annotated with @Slf4j
Logger Name (Grails 3.3.x or higher) |
Logger Name (Grails 3.2.x or lower) |
|
|
BookService.groovy
located at grails-app/services/com/company
annotated with @Slf4j
Logger Name (Grails 3.3.x or higher) |
Logger Name (Grails 3.2.x or lower) |
|
|
BookDetail.groovy
located at src/main/groovy/com/company
annotated with @Slf4j
Logger Name (Grails 3.3.x or higher) |
Logger Name (Grails 3.2.x or lower) |
|
|