Quarkus - Configuring Logging
This guide explains logging and how to configure it.
Run Time Configuration
Run time configuration of logging is done through the normal application.properties
file.
Console configuration
Console logging is enabled by default. To configure or disable it, the following configuration properties are used:
Property Name | Default | Description |
---|---|---|
|
|
Determine whether console logging is enabled. |
|
|
The format pattern to use for logging to the console; see Format String. |
|
|
The minimum log level to display to the console. |
|
|
Allow color rendering to be used on the console, if it is supported by the terminal. |
File configuration
Logging to a file is also supported and enabled by default. To configure or disable this behavior, use the following configuration properties:
Property Name | Default | Description |
---|---|---|
|
|
Determine whether file logging is enabled. |
|
|
The format pattern to use for logging to a file; see Format String. |
|
|
The minimum log level to write to the log file. |
|
|
The path of the log file. |
Logging categories
Logging is done on a per-category basis. Each category can be independently configured. A configuration which applies to a category will also apply to all sub-categories of that category, unless there is a more specific matching sub-category configuration.
Property Name | Default | Description |
---|---|---|
|
|
The level to use to configure the category named |
The quotes shown in the property name are required as categories normally contain '.' which must be escaped. An example is shown in File TRACE Logging Configuration. |
Format String
The logging format string supports the following symbols:
Symbol | Summary | Description |
---|---|---|
|
|
Renders a simple |
|
Category |
Renders the category name. |
|
Source class |
Renders the source class name.[2] |
|
Date |
Renders a date with the given date format string, which uses the syntax defined by |
|
Exception |
Renders the thrown exception, if any. |
|
Source file |
Renders the source file name.[2] |
|
Host name |
Renders the system simple host name. |
|
Qualified host name |
Renders the system’s fully qualified host name, which may be the same as the simple host name, depending on OS configuration. |
|
Process ID |
Render the current process PID. |
|
Source location |
Renders the source location information, which includes source file name, line number, class name, and method name.[2] |
|
Source line |
Renders the source line number.[2] |
|
Full Message |
Renders the log message plus exception (if any). |
|
Source method |
Renders the source method name.[2] |
|
Newline |
Renders the platform-specific line separator string. |
|
Process name |
Render the name of the current process. |
|
Level |
Render the log level of the message. |
|
Relative time |
Render the time in milliseconds since the start of the application log. |
|
Simple message |
Renders just the log message, with no exception trace. |
|
Thread name |
Render the thread name. |
|
Thread ID |
Render the thread ID. |
|
Time zone |
Set the time zone of the output to |
Examples
quarkus.log.console.enable=true
quarkus.log.console.format=%d{HH:mm:ss} %-5p [%c{2.}]] (%t) %s%e%n
quarkus.log.console.level=DEBUG
quarkus.log.console.color=false
quarkus.log.file.enable=true
# Send output to a trace.log file under the /tmp directory
quarkus.log.file.path=/tmp/trace.log
quarkus.log.file.level=TRACE
quarkus.log.file.format=%d{HH:mm:ss} %-5p [%c{2.}]] (%t) %s%e%n
# Set 2 categories (io.quarkus.smallrye.jwt, io.undertow.request.security) to TRACE level
quarkus.log.category."io.quarkus.smallrye.jwt".level=TRACE
quarkus.log.category."io.undertow.request.security".level=TRACE