The English version of quarkus.io is the official project site. Translated sites are community supported on a best-effort basis.

ロギング設定

QuarkusでのロギングAPIの使用、ロギング出力の設定、他のロギングAPIからの出力を統一するためのロギングアダプタの使用について解説します。

Quarkus uses the JBoss Log Manager logging backend for publishing application and framework logs. Quarkus supports the JBoss Logging API and multiple other logging APIs, seamlessly integrated with JBoss Log Manager. You can use any of the following APIs:

アプリケーションのロギングに JBoss Logging を使用

JBoss Logging APIを使用する場合、Quarkusが自動的に提供するため、アプリケーションに追加の依存関係は必要ありません。

JBoss Logging API を使用してメッセージをログに記録する例:
import org.jboss.logging.Logger;

import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;

@Path("/hello")
public class ExampleResource {

    private static final Logger LOG = Logger.getLogger(ExampleResource.class);

    @GET
    @Produces(MediaType.TEXT_PLAIN)
    public String hello() {
        LOG.info("Hello");
        return "hello";
    }
}
JBoss Logging はログメッセージを直接 JBoss Log Manager にルーティングしますが、ライブラリーの 1 つが別のロギング API に依存している場合があります。このような場合、 ログアダプター を使用して、そのログメッセージが JBoss Log Manager にもルーティングされるようにする必要があります。

アプリケーションロガーの取得

Quarkusでは、アプリケーションロガーを取得する最も一般的な方法は以下のとおりです:

ロガー・フィールドの宣言

この古典的なアプローチでは、特定のAPIを使用してロガーインスタンスを取得し、それをクラスの静的フィールドに格納し、このインスタンスに対してロギング操作を呼び出します。

同じフローは、 サポートされているどのロギングAPI でも適用できます。

JBoss Logging API を使用してロガーインスタンスを静的フィールドに格納する例:
package com.example;
import org.jboss.logging.Logger;

public class MyService {
    private static final Logger log = Logger.getLogger(MyService.class); (1)

    public void doSomething() {
        log.info("It works!"); (2)
    }
}
1 ロガーフィールドを定義します。
2 log オブジェクトに対して、必要なロギングメソッドを呼び出します。

簡易ロギング

Quarkus は、 io.quarkus.logging.Log を使用するクラスにロガーフィールドを自動的に追加することで、ロギングを簡素化します。 これにより、反復的な定型コードが不要になり、ロギング設定の利便性が向上します。

静的メソッド呼び出しを使った簡易ロギングの例:
package com.example;

import io.quarkus.logging.Log; (1)

class MyService { (2)
    public void doSomething() {
        Log.info("Simple!"); (3)
    }
}
1 io.quarkus.logging.Log クラスには、 static であることを除き、JBoss Logging と同じメソッドがあります。
2 このクラスはロガー・フィールドを宣言していないことに注意してください。 これは、アプリケーションのビルド中に、 Log API を使用する各クラスに private static final org.jboss.logging.Logger フィールドが自動的に作成されるためです。 Log メソッドを呼び出すクラスの完全修飾名が、ロガー名として使用されます。この例では、ロガー名は com.example.MyService です。
3 最後に、 Log メソッドへのすべての呼び出しは、アプリケーションビルド中に logger フィールドの通常の JBoss Logging 呼び出しに書き換えられます。
Log APIはアプリケーションクラスでのみ使用し、外部の依存関係では使用しないでください。ビルド時にQuarkusによって処理されていない Log メソッド呼び出しは、例外が発生します。

設定されたロガーの注入

@Inject アノテーションで設定された org.jboss.logging.Logger ロガーインスタンスの注入は、 アプリケーションロガーを追加するもう一つの選択肢ですが、 CDI Beanにのみ適用できます。

@Inject Logger log を使用すると、ロガーは注入したクラスと同じ名前になり、 @Inject @LoggerName("…​") Logger log を使用すると、ロガーは指定された名前になります。注入されると、 log オブジェクトを使用して、ロギングメソッドを呼び出すことができます。

2つの異なるタイプのロガーの注入例:
import org.jboss.logging.Logger;

@ApplicationScoped
class SimpleBean {

   @Inject
   Logger log; (1)

   @LoggerName("foo")
   Logger fooLog; (2)

   public void ping() {
     log.info("Simple!");
     fooLog.info("Goes to _foo_ logger!");
   }
}
1 宣言クラスのFQCNがロガー名として使用されます。例えば、 org.jboss.logging.Logger.getLogger(SimpleBean.class) が使用されます。
2 この場合、 foo という名前がロガー名として使われ、例えば、 org.jboss.logging.Logger.getLogger("foo") が使われます。
ロガーインスタンスは、内部的にキャッシュされます。したがって、ロガーが例えば @RequestScoped Bean に注入されるとき、ロガーのインスタンス化に関連する可能性のあるパフォーマンスペナルティを避けるために、ロガーはすべての Bean インスタンスで共有されます。

ログレベルの使用

Quarkusにはさまざまなログレベルが用意されており、開発者はイベントの重大性に基づいてログに記録される情報量を制御できます。

Quarkusが使用するログレベル
OFF

ロギングをオフにするために設定で使用する特別なレベル。

FATAL

致命的なサービス障害、またはあらゆる種類のリクエストに対応できないこと。

ERROR

リクエストの大幅な中断、またはリクエストに対応できないこと

WARN

重要ではないサービスのエラーや問題で、すぐに修正する必要がない場合があります

INFO

サービスライフサイクルのイベントや、関連する重要な超低頻度情報。

DEBUG

デバッグに便利な、ライフサイクル関連のイベントやリクエストに紐づかないイベントに関する追加情報を伝えるメッセージ。

TRACE

リクエストごとのデバッグ情報を伝えるメッセージで、非常に高い頻度で送信される可能性があります

ALL

カスタム・レベルを含むすべてのメッセージのロギングを有効にするために、設定で使用する特別なレベル。

java.util.logging を使用するアプリケーションやライブラリに対して、以下のレベルを設定することもできます。 :

SEVERE

ERROR と同じ

WARNING

WARN と同じ

CONFIG

サービス構成情報

FINE

DEBUG と同じ

FINER

TRACE と同じ

FINEST

TRACE と比較して、更に度合いの強いデバッグ出力。高頻度の場合があります。

Table 1. レベル間のマッピング
レベルの数値 標準レベル名 相当する java.util.logging (JUL) レベル名

1100

FATAL

該当なし

1000

ERROR

SEVERE

900

WARN

WARNING

800

INFO

INFO

700

該当なし

CONFIG

500

DEBUG

FINE

400

TRACE

FINER

300

該当なし

FINEST

ログレベル、カテゴリー、フォーマットの設定

JBossロギングはQuarkusに組み込まれており、 サポートされているすべてのロギングAPI に対して 統一された設定 を提供します。

application.properties ファイルで実行時ロギングを設定してください。

An example of how you can set the default log level to INFO logging and include Hibernate DEBUG logs:
quarkus.log.level=INFO
quarkus.log.category."org.hibernate".level=DEBUG

When you set the log level to below DEBUG, you must also adjust the minimum log level. This setting is either global, using the quarkus.log.min-level configuration property, or per category:

quarkus.log.category."org.hibernate".min-level=TRACE

This sets a floor level for which Quarkus needs to generate supporting code. The minimum log level must be set at build time so that Quarkus can open the door to optimization opportunities where logging on unusable levels can be elided.

An example from native execution:

Setting INFO as the minimum logging level sets lower-level checks, such as isTraceEnabled, to false. This identifies code like if(logger.isDebug()) callMethod(); that will never be executed and mark it as "dead."

If you add these properties on the command line, ensure the " character is escaped properly:

-Dquarkus.log.category.\"org.hibernate\".level=TRACE

All potential properties are listed in the logging configuration reference section.

ロギングカテゴリ

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." 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.

Example 1. すべてのカテゴリーに適用されるグローバル設定の例:
quarkus.log.handlers=console,mylog

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

Example 2. カテゴリーごとの設定例:
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.

For more information, see Logging configuration reference.

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.

An example use case can be a desire to use a different timestamp format for log messages which are saved to a file than the format used for other handlers.

For further demonstration, see the outputs of the Attaching named handlers to a category example.

プロパティ名 デフォルト 説明

quarkus.log.category."<category-name>".level

INFO [1]

<category-name> という名前のカテゴリを設定するために使用するレベル。クオートが必要です。

quarkus.log.category."<category-name>".min-level

DEBUG

<category-name> という名前のカテゴリを設定するために使用する最小ロギングレベル。クオートが必要です。

quarkus.log.category."<category-name>".use-parent-handlers

true

このロガーがその出力を親ロガーに送信するかどうかを指定します。

quarkus.log.category."<category-name>".handlers=[<handler>]

empty [2]

特定のカテゴリにアタッチしたいハンドラーの名前です。

The . symbol separates the specific parts in the configuration property. The quotes in the property name are used as a required escape to keep category specifications, such as quarkus.log.category."io.quarkus.smallrye.jwt".level=TRACE, intact.

ルートロガーの設定

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

プロパティ名 デフォルト 説明

quarkus.log.level

INFO

各ログカテゴリのデフォルトのログレベル。

quarkus.log.min-level

DEBUG

各ログカテゴリのデフォルトの最小ログレベル。

  • The parent category is examined if no level configuration exists for a given logger category.

  • The root logger configuration is used if no specific configurations are provided for the category and any of its parent categories.

ルートロガーのハンドラは、通常、 quarkus.log.consolequarkus.log.file および quarkus.log.syslog によって直接設定されますが、 quarkus.log.handlers プロパティを使用して、追加の名前付きハンドラを添付することができます。

ロギングフォーマット

Quarkus uses a pattern-based logging formatter that generates human-readable text logs by default, but you can also configure the format for each log handler by using a dedicated property.

For the console handler, the property is quarkus.log.console.format.

ログフォーマット文字列は、以下のシンボルをサポートしています。

Symbol 概要 説明

%%

%

単に % 文字をレンダリングします。

%c

カテゴリ

カテゴリ名をレンダリングします。

%C

ソースクラス

ソースクラス名をレンダリングします。 [3]

d{xxx}.

日付

java.text.SimpleDateFormat で定義されている構文を使用した、指定した日付書式の文字列で日付をレンダリングします。

%e

Exception

投げられた例外があれば、その例外をレンダリングします。

%F

ソースファイル

ソースファイル名をレンダリングします。 [3]

%h

ホスト名

システムの単純なホスト名をレンダリングします。

%H

修飾ホスト名

Renders the system’s fully qualified host name, which may be the same as the simple host name, depending on operating system configuration.

%i

プロセスID

現在のプロセスPIDをレンダリングします。

%l

ソースの場所

ソースファイル名、行番号、クラス名、メソッド名を含むソース・ロケーション情報をレンダリングします。 [3]

%L

ソースライン

ソース行番号をレンダリングします。 [3]

%m

フルメッセージ

ログメッセージと例外(もしあれば)を表示します。

%M

ソース・メソッド

ソースメソッド名をレンダリングします。 [3]

%n

改行

プラットフォーム固有の改行文字列をレンダリングします。

%N

プロセス名

現在のプロセスの名前をレンダリングします。

%p

レベル

メッセージのログレベルをレンダリングします。

%r

相対時間

アプリケーションログの開始からの時間をミリ秒単位でレンダリングします。

%s

シンプルなメッセージ

ログメッセージのみを表示し、例外のトレースは表示しません。

%t

スレッド名

スレッド名をレンダリングします。

%t{id}

スレッドID

スレッドIDをレンダリングします。

%z{<zone name>}

タイムゾーン

出力のタイムゾーンを <zone name> に設定します。

%X{<MDC property name>}

Mapped Diagnostic Context Value

Renders the value from Mapped Diagnostic Context

%X

Mapped Diagnostic Context Values

Renders all the values from Mapped Diagnostic Context in format {property.key=property.value}

%x

入れ子診断のコンテキスト値

ネストされた診断コンテキストからのすべての値を {value1.value2} 形式でレンダリングします。

Alternative console logging formats

Changing the console log format is useful, for example, when the console output of the Quarkus application is captured by a service that processes and stores the log information for later analysis.

JSONロギングフォーマット

The quarkus-logging-json extension may be employed to add support for the JSON logging format and its related configuration.

Add this extension to your build file as the following snippet illustrates:

pom.xml
<dependency>
    <groupId>io.quarkus</groupId>
    <artifactId>quarkus-logging-json</artifactId>
</dependency>
build.gradle
implementation("io.quarkus:quarkus-logging-json")

By default, the presence of this extension replaces the output format configuration from the console configuration, and the format string and the color settings (if any) are ignored. The other console configuration items, including those controlling asynchronous logging and the log level, will continue to be applied.

For some, it will make sense to use humanly readable (unstructured) logging in dev mode and JSON logging (structured) in production mode. This can be achieved using different profiles, as shown in the following configuration.

application.properties で dev および test モードに対する JSONロギングを無効にする
%dev.quarkus.log.console.json=false
%test.quarkus.log.console.json=false
設定

Configure the JSON logging extension using supported properties to customize its behavior.

ビルド時に固定される構成プロパティ - 他のすべての構成プロパティは実行時にオーバーライド可能

Console logging

デフォルト

Determine whether to enable the JSON console formatting extension, which disables "normal" console formatting.

Environment variable: QUARKUS_LOG_CONSOLE_JSON

Show more

boolean

true

Enable "pretty printing" of the JSON record. Note that some JSON parsers will fail to read the pretty printed output.

Environment variable: QUARKUS_LOG_CONSOLE_JSON_PRETTY_PRINT

Show more

boolean

false

The date format to use. The special string "default" indicates that the default format should be used.

Environment variable: QUARKUS_LOG_CONSOLE_JSON_DATE_FORMAT

Show more

string

default

The special end-of-record delimiter to be used. By default, newline is used.

Environment variable: QUARKUS_LOG_CONSOLE_JSON_RECORD_DELIMITER

Show more

string

The zone ID to use. The special string "default" indicates that the default zone should be used.

Environment variable: QUARKUS_LOG_CONSOLE_JSON_ZONE_ID

Show more

string

default

The exception output type to specify.

Environment variable: QUARKUS_LOG_CONSOLE_JSON_EXCEPTION_OUTPUT_TYPE

Show more

detailed, formatted, detailed-and-formatted

detailed

Enable printing of more details in the log.

Printing the details can be expensive as the values are retrieved from the caller. The details include the source class name, source file name, source method name, and source line number.

Environment variable: QUARKUS_LOG_CONSOLE_JSON_PRINT_DETAILS

Show more

boolean

false

Override keys with custom values. Omitting this value indicates that no key overrides will be applied.

Environment variable: QUARKUS_LOG_CONSOLE_JSON_KEY_OVERRIDES

Show more

string

Keys to be excluded from the JSON output.

Environment variable: QUARKUS_LOG_CONSOLE_JSON_EXCLUDED_KEYS

Show more

list of string

Additional field value.

Environment variable: QUARKUS_LOG_CONSOLE_JSON_ADDITIONAL_FIELD__FIELD_NAME__VALUE

Show more

string

required

Additional field type specification. Supported types: string, int, long String is the default if not specified.

Environment variable: QUARKUS_LOG_CONSOLE_JSON_ADDITIONAL_FIELD__FIELD_NAME__TYPE

Show more

string, int, long

string

File logging

デフォルト

Determine whether to enable the JSON console formatting extension, which disables "normal" console formatting.

Environment variable: QUARKUS_LOG_FILE_JSON

Show more

boolean

true

Enable "pretty printing" of the JSON record. Note that some JSON parsers will fail to read the pretty printed output.

Environment variable: QUARKUS_LOG_FILE_JSON_PRETTY_PRINT

Show more

boolean

false

The date format to use. The special string "default" indicates that the default format should be used.

Environment variable: QUARKUS_LOG_FILE_JSON_DATE_FORMAT

Show more

string

default

The special end-of-record delimiter to be used. By default, newline is used.

Environment variable: QUARKUS_LOG_FILE_JSON_RECORD_DELIMITER

Show more

string

The zone ID to use. The special string "default" indicates that the default zone should be used.

Environment variable: QUARKUS_LOG_FILE_JSON_ZONE_ID

Show more

string

default

The exception output type to specify.

Environment variable: QUARKUS_LOG_FILE_JSON_EXCEPTION_OUTPUT_TYPE

Show more

detailed, formatted, detailed-and-formatted

detailed

Enable printing of more details in the log.

Printing the details can be expensive as the values are retrieved from the caller. The details include the source class name, source file name, source method name, and source line number.

Environment variable: QUARKUS_LOG_FILE_JSON_PRINT_DETAILS

Show more

boolean

false

Override keys with custom values. Omitting this value indicates that no key overrides will be applied.

Environment variable: QUARKUS_LOG_FILE_JSON_KEY_OVERRIDES

Show more

string

Keys to be excluded from the JSON output.

Environment variable: QUARKUS_LOG_FILE_JSON_EXCLUDED_KEYS

Show more

list of string

Additional field value.

Environment variable: QUARKUS_LOG_FILE_JSON_ADDITIONAL_FIELD__FIELD_NAME__VALUE

Show more

string

required

Additional field type specification. Supported types: string, int, long String is the default if not specified.

Environment variable: QUARKUS_LOG_FILE_JSON_ADDITIONAL_FIELD__FIELD_NAME__TYPE

Show more

string, int, long

string

Syslog logging

デフォルト

Determine whether to enable the JSON console formatting extension, which disables "normal" console formatting.

Environment variable: QUARKUS_LOG_SYSLOG_JSON

Show more

boolean

true

Enable "pretty printing" of the JSON record. Note that some JSON parsers will fail to read the pretty printed output.

Environment variable: QUARKUS_LOG_SYSLOG_JSON_PRETTY_PRINT

Show more

boolean

false

The date format to use. The special string "default" indicates that the default format should be used.

Environment variable: QUARKUS_LOG_SYSLOG_JSON_DATE_FORMAT

Show more

string

default

The special end-of-record delimiter to be used. By default, newline is used.

Environment variable: QUARKUS_LOG_SYSLOG_JSON_RECORD_DELIMITER

Show more

string

The zone ID to use. The special string "default" indicates that the default zone should be used.

Environment variable: QUARKUS_LOG_SYSLOG_JSON_ZONE_ID

Show more

string

default

The exception output type to specify.

Environment variable: QUARKUS_LOG_SYSLOG_JSON_EXCEPTION_OUTPUT_TYPE

Show more

detailed, formatted, detailed-and-formatted

detailed

Enable printing of more details in the log.

Printing the details can be expensive as the values are retrieved from the caller. The details include the source class name, source file name, source method name, and source line number.

Environment variable: QUARKUS_LOG_SYSLOG_JSON_PRINT_DETAILS

Show more

boolean

false

Override keys with custom values. Omitting this value indicates that no key overrides will be applied.

Environment variable: QUARKUS_LOG_SYSLOG_JSON_KEY_OVERRIDES

Show more

string

Keys to be excluded from the JSON output.

Environment variable: QUARKUS_LOG_SYSLOG_JSON_EXCLUDED_KEYS

Show more

list of string

Additional field value.

Environment variable: QUARKUS_LOG_SYSLOG_JSON_ADDITIONAL_FIELD__FIELD_NAME__VALUE

Show more

string

required

Additional field type specification. Supported types: string, int, long String is the default if not specified.

Environment variable: QUARKUS_LOG_SYSLOG_JSON_ADDITIONAL_FIELD__FIELD_NAME__TYPE

Show more

string, int, long

string

プリティプリント (pretty printing) を有効にすると、特定のプロセッサーやJSONパーサーで解釈できなくなる可能性があります。
詳細の表示は、呼び出し元から値を取得するため、コストがかかる場合があります。詳細には、ソースクラス名、ソースファイル名、ソースメソッド名、ソース行番号などが含まれます。

ログハンドラー

ログハンドラは、ログイベントを受信者に送信するロギングコンポーネントです。 Quarkusには、 コンソールファイルsyslog といった複数のログハンドラがあります。

特集の例では、 com.example をロギング・カテゴリーとして使用しています。

コンソールログハンドラー

コンソールログハンドラーはデフォルトで有効になっており、すべてのログイベントをアプリケーションのコンソール(通常はシステムの stdout )に送ります。

  • グローバル設定の例:

    quarkus.log.console.format=%d{yyyy-MM-dd HH:mm:ss} %-5p [%c] (%t) %s%e%n
  • カテゴリーごとの設定の例:

    quarkus.log.handler.console.my-console-handler.format=%d{yyyy-MM-dd HH:mm:ss} [com.example] %s%e%n
    
    quarkus.log.category."com.example".handlers=my-console-handler
    quarkus.log.category."com.example".use-parent-handlers=false

設定の詳細については、 コンソール・ロギング設定 リファレンスを参照してください。

ファイルログハンドラー

To log events to a file on the application’s host, use the Quarkus file log handler. The file log handler is disabled by default, so you must first enable it.

The Quarkus file log handler supports log file rotation. Log file rotation ensures effective log file management over time by maintaining a specified number of backup log files, while also keeping the primary log file up-to-date and manageable.

Log file rotation ensures effective log file management over time by maintaining a specified number of backup log files, while keeping the primary log file up-to-date and manageable.

  • グローバル設定の例:

    quarkus.log.file.enable=true
    quarkus.log.file.path=application.log
    quarkus.log.file.format=%d{yyyy-MM-dd HH:mm:ss} %-5p [%c] (%t) %s%e%n
  • カテゴリーごとの設定の例:

    quarkus.log.handler.file.my-file-handler.enable=true
    quarkus.log.handler.file.my-file-handler.path=application.log
    quarkus.log.handler.file.my-file-handler.format=%d{yyyy-MM-dd HH:mm:ss} [com.example] %s%e%n
    
    quarkus.log.category."com.example".handlers=my-file-handler
    quarkus.log.category."com.example".use-parent-handlers=false

For details about its configuration, see the file logging configuration reference.

Syslog ログハンドラー

The syslog handler in Quarkus follows the Syslog protocol, which is used to send log messages on UNIX-like systems. It utilizes the protocol defined in RFC 5424.

By default, the syslog handler is disabled. When enabled, it sends all log events to a syslog server, typically the local syslog server for the application.

  • グローバル設定の例:

    quarkus.log.syslog.enable=true
    quarkus.log.syslog.app-name=my-application
    quarkus.log.syslog.format=%d{yyyy-MM-dd HH:mm:ss} %-5p [%c] (%t) %s%e%n
  • カテゴリーごとの設定の例:

    quarkus.log.handler.syslog.my-syslog-handler.enable=true
    quarkus.log.handler.syslog.my-syslog-handler.app-name=my-application
    quarkus.log.handler.syslog.my-syslog-handler.format=%d{yyyy-MM-dd HH:mm:ss} [com.example] %s%e%n
    
    quarkus.log.category."com.example".handlers=my-syslog-handler
    quarkus.log.category."com.example".use-parent-handlers=false

For details about its configuration, see the Syslog logging configuration reference.

ログハンドラーに対するロギングフィルタの追加

コンソールログハンドラーのようなログハンドラーは、ログレコードがログに記録されるべきかどうかを決定する フィルタ とリンクさせることができます。

ロギングフィルターの登録方法

  1. java.util.logging.Filter を実装する final クラスを @io.quarkus.logging.LoggingFilter でアノテートし、 name プロパティを設定します:

    フィルターの書き方の例:
    import io.quarkus.logging.LoggingFilter;
    import java.util.logging.Filter;
    import java.util.logging.LogRecord;
    
    @LoggingFilter(name = "my-filter")
    public final class TestFilter implements Filter {
    
        private final String part;
    
        public TestFilter(@ConfigProperty(name = "my-filter.part") String part) {
            this.part = part;
        }
    
        @Override
        public boolean isLoggable(LogRecord record) {
            return !record.getMessage().contains(part);
        }
    }

    In this example, we exclude log records containing specific text from console logs. The specific text to filter on is not hard-coded; instead, it is read from the my-filter.part configuration property.

    An example of Configuring the filter in application.properties:
    my-filter.part=TEST
  2. Attach the filter to the corresponding handler using the filter configuration property, located in application.properties:

    quarkus.log.console.filter=my-filter

ロギング設定の例

The following examples show some of the ways in which you can configure logging in Quarkus:

Console DEBUG logging except for Quarkus logs (INFO), no color, shortened time, shortened category prefixes
quarkus.log.console.format=%d{HH:mm:ss} %-5p [%c{2.}] (%t) %s%e%n
quarkus.log.console.level=DEBUG
quarkus.console.color=false

quarkus.log.category."io.quarkus".level=INFO
If you add these properties in the command line, ensure " is escaped. For example, -Dquarkus.log.category.\"io.quarkus\".level=DEBUG.
File TRACE logging configuration
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.min-level=TRACE
quarkus.log.category."io.quarkus.smallrye.jwt".level=TRACE
quarkus.log.category."io.undertow.request.security".level=TRACE
As we don’t change the root logger, the console log will only contain INFO or higher level logs.
カテゴリにアタッチされた名前付きハンドラー
# Send output to a trace.log file under the /tmp directory
quarkus.log.file.path=/tmp/trace.log
quarkus.log.console.format=%d{HH:mm:ss} %-5p [%c{2.}] (%t) %s%e%n
# Configure a named handler that logs to console
quarkus.log.handler.console."STRUCTURED_LOGGING".format=%e%n
# Configure a named handler that logs to file
quarkus.log.handler.file."STRUCTURED_LOGGING_FILE".enable=true
quarkus.log.handler.file."STRUCTURED_LOGGING_FILE".format=%e%n
# Configure the category and link the two named handlers to it
quarkus.log.category."io.quarkus.category".level=INFO
quarkus.log.category."io.quarkus.category".handlers=STRUCTURED_LOGGING,STRUCTURED_LOGGING_FILE
ルートロガーにアタッチされた名前付きハンドラー
# configure a named file handler that sends the output to 'quarkus.log'
quarkus.log.handler.file.CONSOLE_MIRROR.enable=true
quarkus.log.handler.file.CONSOLE_MIRROR.path=quarkus.log
# attach the handler to the root logger
quarkus.log.handlers=CONSOLE_MIRROR

ログの一元管理

Use a centralized location to efficiently collect, store, and analyze log data from various components and instances of the application.

Graylog、Logstash、Fluentdなどの集中型ツールにログを送信するには、Quarkusの 集中型ログ管理 ガイドを参照してください。

Configure logging for @QuarkusTest

Enable proper logging for @QuarkusTest by setting the java.util.logging.manager system property to org.jboss.logmanager.LogManager.

The system property must be set early on to be effective, so it is recommended to configure it in the build system.

Setting the java.util.logging.manager system property in the Maven Surefire plugin configuration
<build>
  <plugins>
    <plugin>
      <artifactId>maven-surefire-plugin</artifactId>
      <version>${surefire-plugin.version}</version>
      <configuration>
        <systemPropertyVariables>
          <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager> (1)
          <quarkus.log.level>DEBUG</quarkus.log.level>  (2)
          <maven.home>${maven.home}</maven.home>
        </systemPropertyVariables>
      </configuration>
    </plugin>
  </plugins>
</build>
1 org.jboss.logmanager.LogManager が使用されていることを確認してください。
2 すべてのロギングカテゴリのデバッグロギングを有効にします。

Gradleの場合は、 build.gradle ファイルに以下の設定を追加します:

test {
	systemProperty "java.util.logging.manager", "org.jboss.logmanager.LogManager"
}

IDEから`@QuarkusTest` を実行 も参照してください。

他のロギングAPIの使用

Quarkusは、すべてのロギング要件をJBoss Loggingライブラリに依存しています。

Suppose you use libraries that depend on other logging libraries, such as Apache Commons Logging, Log4j, or SLF4J. In that case, exclude them from the dependencies and use one of the JBoss Logging adapters.

This is especially important when building native executables, as you could encounter issues similar to the following when compiling the native executable:

Caused by java.lang.ClassNotFoundException: org.apache.commons.logging.impl.LogFactoryImpl

The logging implementation is not included in the native executable, but you can resolve this issue using JBoss Logging adapters.

These adapters are available for popular open-source logging components, as explained in the next chapter.

Add a logging adapter to your application

For each logging API that is not jboss-logging:

  1. Add a logging adapter library to ensure that messages logged through these APIs are routed to the JBoss Log Manager backend.

    This step is unnecessary for libraries that are dependencies of a Quarkus extension where the extension handles it automatically.
    • Apache Commons Logging:

      pom.xml
      <dependency>
          <groupId>org.jboss.logging</groupId>
          <artifactId>commons-logging-jboss-logging</artifactId>
      </dependency>
      build.gradle
      implementation("org.jboss.logging:commons-logging-jboss-logging")
    • Log4j:

      pom.xml
      <dependency>
          <groupId>org.jboss.logmanager</groupId>
          <artifactId>log4j-jboss-logmanager</artifactId>
      </dependency>
      build.gradle
      implementation("org.jboss.logmanager:log4j-jboss-logmanager")
    • Log4j 2:

      pom.xml
      <dependency>
          <groupId>org.jboss.logmanager</groupId>
          <artifactId>log4j2-jboss-logmanager</artifactId>
      </dependency>
      build.gradle
      implementation("org.jboss.logmanager:log4j2-jboss-logmanager")

      Do not include any Log4j dependencies because the log4j2-jboss-logmanager library contains all that is needed to use Log4j as a logging implementation.

    • SLF4J:

      pom.xml
      <dependency>
          <groupId>org.jboss.slf4j</groupId>
          <artifactId>slf4j-jboss-logmanager</artifactId>
      </dependency>
      build.gradle
      implementation("org.jboss.slf4j:slf4j-jboss-logmanager")
  2. Verify whether the logs generated by the added library adhere to the same format as the other Quarkus logs.

Use MDC to add contextual log information

Quarkus overrides the logging Mapped Diagnostic Context (MDC) to improve the compatibility with its reactive core.

MDCデータの追加と読込

To add data to the MDC and extract it in your log output:

  1. Use the MDC class to set the data.

  2. Customize the log format to use %X{mdc-key}.

次のコードを考えてみましょう:

Example with JBoss Logging and io.quarkus.logging.Log
package me.sample;

import io.quarkus.logging.Log;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import org.jboss.logmanager.MDC;

import java.util.UUID;

@Path("/hello/jboss")
public class GreetingResourceJbossLogging {

    @GET
    @Path("/test")
    public String greeting() {
        MDC.put("request.id", UUID.randomUUID().toString());
        MDC.put("request.path", "/hello/test");
        Log.info("request received");
        return "hello world!";
    }
}

If you configure the log format with the following line:

quarkus.log.console.format=%d{HH:mm:ss} %-5p request.id=%X{request.id} request.path=%X{request.path} [%c{2.}] (%t) %s%n

You get messages containing the MDC data:

08:48:13 INFO request.id=c37a3a36-b7f6-4492-83a1-de41dbc26fe2 request.path=/hello/test [me.sa.GreetingResourceJbossLogging] (executor-thread-1) request received

MDCとサポートされるロギングAPI

使用するAPIによって、MDCクラスは若干異なります。しかし、APIは非常によく似ています:

  • Log4j 1 - org.apache.log4j.MDC.put(key, value)

  • Log4j 2 - org.apache.logging.log4j.ThreadContext.put(key, value)

  • SLF4J - org.slf4j.MDC.put(key, value)

MDCの伝播

Quarkusでは、MDCプロバイダにはリアクティブコンテキストを処理するための特別な実装があり、リアクティブ処理や非同期処理中にMDCデータが確実に伝搬されます。

その結果、さまざまなシナリオでMDCデータにアクセスすることができます:

  • 非同期呼び出しの後、例えばRESTクライアントがUniを返す場合:

  • org.eclipse.microprofile.context.ManagedExecutor に送信されたコードで:

  • vertx.executeBlocking() で実行されるコードで:

該当する場合、MDCデータは、単一のタスク(リクエスト)を処理するための分離されたコンテキストである、 複製されたコンテキスト に格納されます。

ロギング設定リファレンス

ビルド時に固定される設定プロパティ - その他の設定プロパティは実行時にオーバーライド可能です。

Configuration property

デフォルト

The log level of the root category, which is used as the default log level for all categories.

JBoss Logging supports Apache-style log levels:

  • {@link org.jboss.logmanager.Level#FATAL}

  • {@link org.jboss.logmanager.Level#ERROR}

  • {@link org.jboss.logmanager.Level#WARN}

  • {@link org.jboss.logmanager.Level#INFO}

  • {@link org.jboss.logmanager.Level#DEBUG}

  • {@link org.jboss.logmanager.Level#TRACE}

In addition, it also supports the standard JDK log levels.

Environment variable: QUARKUS_LOG_LEVEL

Show more

Level

INFO

The names of additional handlers to link to the root category. These handlers are defined in consoleHandlers, fileHandlers, or syslogHandlers.

Environment variable: QUARKUS_LOG_HANDLERS

Show more

list of string

Console logging

デフォルト

If console logging should be enabled

Environment variable: QUARKUS_LOG_CONSOLE_ENABLE

Show more

boolean

true

If console logging should go to System#err instead of System#out.

Environment variable: QUARKUS_LOG_CONSOLE_STDERR

Show more

boolean

false

The log format. Note that this value is ignored if an extension is present that takes control of console formatting (e.g., an XML or JSON-format extension).

Environment variable: QUARKUS_LOG_CONSOLE_FORMAT

Show more

string

%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c{3.}] (%t) %s%e%n

The console log level.

Environment variable: QUARKUS_LOG_CONSOLE_LEVEL

Show more

Level

ALL

Specify how much the colors should be darkened. Note that this value is ignored if an extension is present that takes control of console formatting (e.g., an XML or JSON-format extension).

Environment variable: QUARKUS_LOG_CONSOLE_DARKEN

Show more

int

0

The name of the filter to link to the console handler.

Environment variable: QUARKUS_LOG_CONSOLE_FILTER

Show more

string

Indicates whether to log asynchronously

Environment variable: QUARKUS_LOG_CONSOLE_ASYNC

Show more

boolean

false

The queue length to use before flushing writing

Environment variable: QUARKUS_LOG_CONSOLE_ASYNC_QUEUE_LENGTH

Show more

int

512

Determine whether to block the publisher (rather than drop the message) when the queue is full

Environment variable: QUARKUS_LOG_CONSOLE_ASYNC_OVERFLOW

Show more

block, discard

block

File logging

デフォルト

If file logging should be enabled

Environment variable: QUARKUS_LOG_FILE_ENABLE

Show more

boolean

false

The log format

Environment variable: QUARKUS_LOG_FILE_FORMAT

Show more

string

%d{yyyy-MM-dd HH:mm:ss,SSS} %h %N[%i] %-5p [%c{3.}] (%t) %s%e%n

The level of logs to be written into the file.

Environment variable: QUARKUS_LOG_FILE_LEVEL

Show more

Level

ALL

The name of the file in which logs will be written.

Environment variable: QUARKUS_LOG_FILE_PATH

Show more

File

quarkus.log

The name of the filter to link to the file handler.

Environment variable: QUARKUS_LOG_FILE_FILTER

Show more

string

The character encoding used

Environment variable: QUARKUS_LOG_FILE_ENCODING

Show more

Charset

Indicates whether to log asynchronously

Environment variable: QUARKUS_LOG_FILE_ASYNC

Show more

boolean

false

The queue length to use before flushing writing

Environment variable: QUARKUS_LOG_FILE_ASYNC_QUEUE_LENGTH

Show more

int

512

Determine whether to block the publisher (rather than drop the message) when the queue is full

Environment variable: QUARKUS_LOG_FILE_ASYNC_OVERFLOW

Show more

block, discard

block

The maximum log file size, after which a rotation is executed.

Environment variable: QUARKUS_LOG_FILE_ROTATION_MAX_FILE_SIZE

Show more

MemorySize

10M

The maximum number of backups to keep.

Environment variable: QUARKUS_LOG_FILE_ROTATION_MAX_BACKUP_INDEX

Show more

int

5

The file handler rotation file suffix. When used, the file will be rotated based on its suffix.

Example fileSuffix: .yyyy-MM-dd

Note: If the suffix ends with .zip or .gz, the rotation file will also be compressed.

Environment variable: QUARKUS_LOG_FILE_ROTATION_FILE_SUFFIX

Show more

string

Indicates whether to rotate log files on server initialization.

You need to either set a max-file-size or configure a file-suffix for it to work.

Environment variable: QUARKUS_LOG_FILE_ROTATION_ROTATE_ON_BOOT

Show more

boolean

true

Syslog logging

デフォルト

If syslog logging should be enabled

Environment variable: QUARKUS_LOG_SYSLOG_ENABLE

Show more

boolean

false

The IP address and port of the Syslog server

Environment variable: QUARKUS_LOG_SYSLOG_ENDPOINT

Show more

host:port

localhost:514

The app name used when formatting the message in RFC5424 format

Environment variable: QUARKUS_LOG_SYSLOG_APP_NAME

Show more

string

The name of the host the messages are being sent from

Environment variable: QUARKUS_LOG_SYSLOG_HOSTNAME

Show more

string

Sets the facility used when calculating the priority of the message as defined by RFC-5424 and RFC-3164

Environment variable: QUARKUS_LOG_SYSLOG_FACILITY

Show more

kernel, user-level, mail-system, system-daemons, security, syslogd, line-printer, network-news, uucp, clock-daemon, security2, ftp-daemon, ntp, log-audit, log-alert, clock-daemon2, local-use-0, local-use-1, local-use-2, local-use-3, local-use-4, local-use-5, local-use-6, local-use-7

user-level

Set the SyslogType syslog type this handler should use to format the message sent

Environment variable: QUARKUS_LOG_SYSLOG_SYSLOG_TYPE

Show more

rfc5424, rfc3164

rfc5424

Sets the protocol used to connect to the Syslog server

Environment variable: QUARKUS_LOG_SYSLOG_PROTOCOL

Show more

tcp, udp, ssl-tcp

tcp

If enabled, the message being sent is prefixed with the size of the message

Environment variable: QUARKUS_LOG_SYSLOG_USE_COUNTING_FRAMING

Show more

boolean

false

Set to true to truncate the message if it exceeds maximum length

Environment variable: QUARKUS_LOG_SYSLOG_TRUNCATE

Show more

boolean

true

Enables or disables blocking when attempting to reconnect a org.jboss.logmanager.handlers.SyslogHandler.Protocol#TCP TCP or org.jboss.logmanager.handlers.SyslogHandler.Protocol#SSL_TCP SSL TCP protocol

Environment variable: QUARKUS_LOG_SYSLOG_BLOCK_ON_RECONNECT

Show more

boolean

false

The log message format

Environment variable: QUARKUS_LOG_SYSLOG_FORMAT

Show more

string

%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c{3.}] (%t) %s%e%n

The log level specifying what message levels will be logged by the Syslog logger

Environment variable: QUARKUS_LOG_SYSLOG_LEVEL

Show more

Level

ALL

The name of the filter to link to the file handler.

Environment variable: QUARKUS_LOG_SYSLOG_FILTER

Show more

string

Indicates whether to log asynchronously

Environment variable: QUARKUS_LOG_SYSLOG_ASYNC

Show more

boolean

false

The queue length to use before flushing writing

Environment variable: QUARKUS_LOG_SYSLOG_ASYNC_QUEUE_LENGTH

Show more

int

512

Determine whether to block the publisher (rather than drop the message) when the queue is full

Environment variable: QUARKUS_LOG_SYSLOG_ASYNC_OVERFLOW

Show more

block, discard

block

Logging categories

デフォルト

The log level for this category.

Note that to get log levels below INFO, the minimum level build-time configuration option also needs to be adjusted.

Environment variable: QUARKUS_LOG_CATEGORY__CATEGORIES__LEVEL

Show more

InheritableLevel

inherit

The names of the handlers to link to this category.

Environment variable: QUARKUS_LOG_CATEGORY__CATEGORIES__HANDLERS

Show more

list of string

Specify whether this logger should send its output to its parent Logger

Environment variable: QUARKUS_LOG_CATEGORY__CATEGORIES__USE_PARENT_HANDLERS

Show more

boolean

true

Console handlers

デフォルト

If console logging should be enabled

Environment variable: QUARKUS_LOG_HANDLER_CONSOLE__CONSOLE_HANDLERS__ENABLE

Show more

boolean

true

If console logging should go to System#err instead of System#out.

Environment variable: QUARKUS_LOG_HANDLER_CONSOLE__CONSOLE_HANDLERS__STDERR

Show more

boolean

false

The log format. Note that this value is ignored if an extension is present that takes control of console formatting (e.g., an XML or JSON-format extension).

Environment variable: QUARKUS_LOG_HANDLER_CONSOLE__CONSOLE_HANDLERS__FORMAT

Show more

string

%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c{3.}] (%t) %s%e%n

The console log level.

Environment variable: QUARKUS_LOG_HANDLER_CONSOLE__CONSOLE_HANDLERS__LEVEL

Show more

Level

ALL

Specify how much the colors should be darkened. Note that this value is ignored if an extension is present that takes control of console formatting (e.g., an XML or JSON-format extension).

Environment variable: QUARKUS_LOG_HANDLER_CONSOLE__CONSOLE_HANDLERS__DARKEN

Show more

int

0

The name of the filter to link to the console handler.

Environment variable: QUARKUS_LOG_HANDLER_CONSOLE__CONSOLE_HANDLERS__FILTER

Show more

string

Indicates whether to log asynchronously

Environment variable: QUARKUS_LOG_HANDLER_CONSOLE__CONSOLE_HANDLERS__ASYNC

Show more

boolean

false

The queue length to use before flushing writing

Environment variable: QUARKUS_LOG_HANDLER_CONSOLE__CONSOLE_HANDLERS__ASYNC_QUEUE_LENGTH

Show more

int

512

Determine whether to block the publisher (rather than drop the message) when the queue is full

Environment variable: QUARKUS_LOG_HANDLER_CONSOLE__CONSOLE_HANDLERS__ASYNC_OVERFLOW

Show more

block, discard

block

File handlers

デフォルト

If file logging should be enabled

Environment variable: QUARKUS_LOG_HANDLER_FILE__FILE_HANDLERS__ENABLE

Show more

boolean

false

The log format

Environment variable: QUARKUS_LOG_HANDLER_FILE__FILE_HANDLERS__FORMAT

Show more

string

%d{yyyy-MM-dd HH:mm:ss,SSS} %h %N[%i] %-5p [%c{3.}] (%t) %s%e%n

The level of logs to be written into the file.

Environment variable: QUARKUS_LOG_HANDLER_FILE__FILE_HANDLERS__LEVEL

Show more

Level

ALL

The name of the file in which logs will be written.

Environment variable: QUARKUS_LOG_HANDLER_FILE__FILE_HANDLERS__PATH

Show more

File

quarkus.log

The name of the filter to link to the file handler.

Environment variable: QUARKUS_LOG_HANDLER_FILE__FILE_HANDLERS__FILTER

Show more

string

The character encoding used

Environment variable: QUARKUS_LOG_HANDLER_FILE__FILE_HANDLERS__ENCODING

Show more

Charset

Indicates whether to log asynchronously

Environment variable: QUARKUS_LOG_HANDLER_FILE__FILE_HANDLERS__ASYNC

Show more

boolean

false

The queue length to use before flushing writing

Environment variable: QUARKUS_LOG_HANDLER_FILE__FILE_HANDLERS__ASYNC_QUEUE_LENGTH

Show more

int

512

Determine whether to block the publisher (rather than drop the message) when the queue is full

Environment variable: QUARKUS_LOG_HANDLER_FILE__FILE_HANDLERS__ASYNC_OVERFLOW

Show more

block, discard

block

The maximum log file size, after which a rotation is executed.

Environment variable: QUARKUS_LOG_HANDLER_FILE__FILE_HANDLERS__ROTATION_MAX_FILE_SIZE

Show more

MemorySize

10M

The maximum number of backups to keep.

Environment variable: QUARKUS_LOG_HANDLER_FILE__FILE_HANDLERS__ROTATION_MAX_BACKUP_INDEX

Show more

int

5

The file handler rotation file suffix. When used, the file will be rotated based on its suffix.

Example fileSuffix: .yyyy-MM-dd

Note: If the suffix ends with .zip or .gz, the rotation file will also be compressed.

Environment variable: QUARKUS_LOG_HANDLER_FILE__FILE_HANDLERS__ROTATION_FILE_SUFFIX

Show more

string

Indicates whether to rotate log files on server initialization.

You need to either set a max-file-size or configure a file-suffix for it to work.

Environment variable: QUARKUS_LOG_HANDLER_FILE__FILE_HANDLERS__ROTATION_ROTATE_ON_BOOT

Show more

boolean

true

Syslog handlers

デフォルト

If syslog logging should be enabled

Environment variable: QUARKUS_LOG_HANDLER_SYSLOG__SYSLOG_HANDLERS__ENABLE

Show more

boolean

false

The IP address and port of the Syslog server

Environment variable: QUARKUS_LOG_HANDLER_SYSLOG__SYSLOG_HANDLERS__ENDPOINT

Show more

host:port

localhost:514

The app name used when formatting the message in RFC5424 format

Environment variable: QUARKUS_LOG_HANDLER_SYSLOG__SYSLOG_HANDLERS__APP_NAME

Show more

string

The name of the host the messages are being sent from

Environment variable: QUARKUS_LOG_HANDLER_SYSLOG__SYSLOG_HANDLERS__HOSTNAME

Show more

string

Sets the facility used when calculating the priority of the message as defined by RFC-5424 and RFC-3164

Environment variable: QUARKUS_LOG_HANDLER_SYSLOG__SYSLOG_HANDLERS__FACILITY

Show more

kernel, user-level, mail-system, system-daemons, security, syslogd, line-printer, network-news, uucp, clock-daemon, security2, ftp-daemon, ntp, log-audit, log-alert, clock-daemon2, local-use-0, local-use-1, local-use-2, local-use-3, local-use-4, local-use-5, local-use-6, local-use-7

user-level

Set the SyslogType syslog type this handler should use to format the message sent

Environment variable: QUARKUS_LOG_HANDLER_SYSLOG__SYSLOG_HANDLERS__SYSLOG_TYPE

Show more

rfc5424, rfc3164

rfc5424

Sets the protocol used to connect to the Syslog server

Environment variable: QUARKUS_LOG_HANDLER_SYSLOG__SYSLOG_HANDLERS__PROTOCOL

Show more

tcp, udp, ssl-tcp

tcp

If enabled, the message being sent is prefixed with the size of the message

Environment variable: QUARKUS_LOG_HANDLER_SYSLOG__SYSLOG_HANDLERS__USE_COUNTING_FRAMING

Show more

boolean

false

Set to true to truncate the message if it exceeds maximum length

Environment variable: QUARKUS_LOG_HANDLER_SYSLOG__SYSLOG_HANDLERS__TRUNCATE

Show more

boolean

true

Enables or disables blocking when attempting to reconnect a org.jboss.logmanager.handlers.SyslogHandler.Protocol#TCP TCP or org.jboss.logmanager.handlers.SyslogHandler.Protocol#SSL_TCP SSL TCP protocol

Environment variable: QUARKUS_LOG_HANDLER_SYSLOG__SYSLOG_HANDLERS__BLOCK_ON_RECONNECT

Show more

boolean

false

The log message format

Environment variable: QUARKUS_LOG_HANDLER_SYSLOG__SYSLOG_HANDLERS__FORMAT

Show more

string

%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c{3.}] (%t) %s%e%n

The log level specifying what message levels will be logged by the Syslog logger

Environment variable: QUARKUS_LOG_HANDLER_SYSLOG__SYSLOG_HANDLERS__LEVEL

Show more

Level

ALL

The name of the filter to link to the file handler.

Environment variable: QUARKUS_LOG_HANDLER_SYSLOG__SYSLOG_HANDLERS__FILTER

Show more

string

Indicates whether to log asynchronously

Environment variable: QUARKUS_LOG_HANDLER_SYSLOG__SYSLOG_HANDLERS__ASYNC

Show more

boolean

false

The queue length to use before flushing writing

Environment variable: QUARKUS_LOG_HANDLER_SYSLOG__SYSLOG_HANDLERS__ASYNC_QUEUE_LENGTH

Show more

int

512

Determine whether to block the publisher (rather than drop the message) when the queue is full

Environment variable: QUARKUS_LOG_HANDLER_SYSLOG__SYSLOG_HANDLERS__ASYNC_OVERFLOW

Show more

block, discard

block

Log cleanup filters - internal use

デフォルト

The message prefix to match

Environment variable: QUARKUS_LOG_FILTER__FILTERS__IF_STARTS_WITH

Show more

list of string

inherit

The new log level for the filtered message. Defaults to DEBUG.

Environment variable: QUARKUS_LOG_FILTER__FILTERS__TARGET_LEVEL

Show more

Level

DEBUG

About the MemorySize format

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


1. いくつかのエクステンションは、ログノイズを削減するために、特定のカテゴリに対してカスタマイズされたデフォルトログレベルを定義しているかもしれません。コンフィグレーションでのログレベル設定は、エクステンション定義のログレベルをオーバーライドします。
2. デフォルトでは設定されたカテゴリはルートロガーにアタッチされたハンドラーと同じものを受け取ります。
3. 呼び出し元の情報を検査するフォーマットシーケンスはパフォーマンスに影響する可能性があります。