Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancements to Configuration section of the Logging guide #35988

Merged
merged 1 commit into from
Sep 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 26 additions & 5 deletions docs/src/main/asciidoc/logging.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -241,13 +241,34 @@

=== Logging categories

Logging is done on a per-category basis, with each category being configured independently.
A category configuration recursively applies to all subcategories of that category unless there is a more specific matching sub-category configuration.
Logging is configured on a per-category basis, with each category being configured independently.
Configuration for a category applies recursively to all subcategories unless there is a more specific subcategory configuration.

The parent of all logging categories is called the "root category".
This category, being the ultimate parent, may contain configuration which applies globally to all other categories. This includes the globally configured handlers and formatters.
The parent of all logging categories is called the "root category."
As the ultimate parent, this category might contain a configuration that applies globally to all other categories.
This includes the globally configured handlers and formatters.

Check warning on line 249 in docs/src/main/asciidoc/logging.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.Spelling] Use correct American English spelling. Did you really mean 'formatters'? Raw Output: {"message": "[Quarkus.Spelling] Use correct American English spelling. Did you really mean 'formatters'?", "location": {"path": "docs/src/main/asciidoc/logging.adoc", "range": {"start": {"line": 249, "column": 52}}}, "severity": "WARNING"}

.An example of a global configuration that applies to all categories:
====
[source, properties]
----
quarkus.log.handlers=console,mylog
----

In this example, the root category is configured to use two handlers: `console` and `mylog`.
====

.An example of a per-category configuration:
====
[source, properties]
----
quarkus.log.category."org.apache.kafka.clients".level=INFO
quarkus.log.category."org.apache.kafka.common.utils".level=INFO
----

This example shows how you can configure the minimal log level on the categories `org.apache.kafka.clients` and `org.apache.kafka.common.utils`.
====

Thus, configurations made under `quarkus.log.console.+*+`, `quarkus.log.file.+*+`, and `quarkus.log.syslog.+*+` are global and apply for all categories.
rsvoboda marked this conversation as resolved.
Show resolved Hide resolved
For more information, see <<loggingConfigurationReference>>.

If you want to configure something extra for a specific category, create a named handler like `quarkus.log.handler.[console|file|syslog].<your-handler-name>.*` and set it up for that category by using `quarkus.log.category.<my-category>.handlers`.
Expand Down