Skip to content

Commit

Permalink
Merge pull request #44583 from SergioRuyDev/fix-44575
Browse files Browse the repository at this point in the history
Improve documentation on the usage of io.quarkus.logging.Log in extensions
  • Loading branch information
geoand authored Nov 21, 2024
2 parents 33fc9cc + 2656790 commit 01ed5f7
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/src/main/asciidoc/logging.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,19 @@ In this example, the logger name would be `com.example.MyService`.
WARNING: Only use the `Log` API in application classes, not in external dependencies.
`Log` method calls that are not processed by Quarkus at build time will throw an exception.

[[log-api-extension-warning]]
==== Important Note on Using `io.quarkus.logging.Log` in Extensions

While the `Log` API simplifies logging in application classes, it should not be used in extension modules or external dependencies. The following considerations apply:

* `io.quarkus.logging.Log` depends on Quarkus bytecode transformations that occur at build time.
* In extension modules, the use of `Log` may work if the module has a Jandex index. However, this behavior is not officially supported and might lead to unreliable logging.

For extension development:

* Use standard loggers like `org.jboss.logging.Logger.getLogger(String)` instead of `io.quarkus.logging.Log`.
* This avoids potential performance issues caused by the stack walk fallback when Quarkus build-time processing is unavailable.


[[injection-of-a-configured-logger]]
=== Injecting a configured logger
Expand Down

0 comments on commit 01ed5f7

Please sign in to comment.