Skip to content

Commit fd2f855

Browse files
authored
Merge pull request #47436 from mipo256/patch-1
Clarified the usage of the @LoggerName with @Inject on loggers
2 parents f2e3cc3 + e7d4914 commit fd2f855

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: 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)