Skip to content

Commit e7d4914

Browse files
authored
Clarified the usage of the @LoggerName with @Inject on loggers
1 parent 86aa614 commit e7d4914

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/src/main/asciidoc/logging.adoc

+3-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,9 @@ For extension development, use `org.jboss.logging.Logger.getLogger(String)` inst
143143

144144
The injection of a configured `org.jboss.logging.Logger` logger instance with the `@Inject` annotation is another alternative to adding an application logger, but is applicable only to CDI beans.
145145

146-
You can use `@Inject Logger log`, where the logger gets named after the class you inject it to, or `@Inject @LoggerName("...") Logger log`, where the logger will receive the specified name.
146+
You can use `@Inject Logger log`, where the logger gets named after the class you inject it to, or `@LoggerName("...") Logger log`, where the logger will receive the specified name. Notice, that `@Inject`
147+
is not required if you already annotated your `Logger` with `@LoggerName("...")`.
148+
147149
Once injected, you can use the `log` object to invoke logging methods.
148150

149151
.An example of two different types of logger injection:

0 commit comments

Comments
 (0)