Quarkus - Configuring Logging

    Run time configuration of logging is done through the normal file.

    Configuration property fixed at build time - ️ Configuration property overridable at runtime

    About the MemorySize formatA size configuration option recognises string in this format (shown as a regular expression): [0-9]+[KkMmGgTtPpEeZzYy]?.If no suffix is given, assume bytes.

    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.

    The quotes shown in the property name are required as categories normally contain '.' which mustbe escaped. An example is shown in File TRACE Logging Configuration.

    Root logger configuration

    The root logger category is handled separately, and is configured via the following properties:

    SymbolSummaryDescription
    %%%Renders a simple % character.
    %cCategoryRenders the category name.
    %CSource classRenders the source class name.[2]
    %d{xxx}DateRenders a date with the given date format string, which uses the syntax defined by java.text.SimpleDateFormat.
    %eExceptionRenders the thrown exception, if any.
    %FSource fileRenders the source file name.[]
    %hHost nameRenders the system simple host name.
    %HQualified host nameRenders the system’s fully qualified host name, which may be the same as the simple host name, depending on OS configuration.
    %iProcess IDRender the current process PID.
    %lSource locationRenders the source location information, which includes source file name, line number, class name, and method name.[2]
    %LSource lineRenders the source line number.[]
    %mFull MessageRenders the log message plus exception (if any).
    %MSource methodRenders the source method name.[2]
    %nNewlineRenders the platform-specific line separator string.
    %NProcess nameRender the name of the current process.
    %pLevelRender the log level of the message.
    %rRelative timeRender the time in milliseconds since the start of the application log.
    %sSimple messageRenders just the log message, with no exception trace.
    %tThread nameRender the thread name.
    %t{id}Thread IDRender the thread ID.
    %z{<zone name>}Time zoneSet the time zone of the output to <zone name>.
    %X{<MDC property name>}Mapped Diagnostics Context ValueRenders the value from Mapped Diagnostics Context
    %XMapped Diagnostics Context ValuesRenders all the values from Mapped Diagnostics Context in format {property.key=property.value}
    %xNested Diagnostics context valuesRenders all the values from Nested Diagnostics Context in format {value1.value2}

    Console DEBUG Logging, No color, Shortened Time, Shortened Category Prefixes

    File TRACE Logging Configuration

    1. quarkus.log.file.enable=true
    2. # Send output to a trace.log file under the /tmp directory
    3. quarkus.log.file.path=/tmp/trace.log
    4. quarkus.log.file.level=TRACE
    5. quarkus.log.file.format=%d{HH:mm:ss} %-5p [%c{2.}] (%t) %s%e%n
    6. quarkus.log.category."io.quarkus.smallrye.jwt".level=TRACE

    Applications and components may use any of the following APIs for logging, and the logs will be merged:

    • JDK java.util.logging


    1. Some extensions may define customized default log levels for certain categories, in order to reduce log noise by default. Setting the log level in configuration will override any extension-defined log levels.

    . Format sequences which examine caller information may affect performance