14.3. CLI でのロギング設定
管理 CLI が実行され、関係する JBoss EAP インスタンスに接続している必要があります。詳細は「管理 CLI の起動」を参照してください。
14.3.1. CLI でのルートロガーの設定
- ルートロガーへのログハンドラーの追加
- ルートロガー設定の表示
- ログレベルの変更
- ルートロガーからログハンドラーを削除
重要
/subsystem=logging/ ではなく /subsystem=logging/logging-profile=NAME/ になります。
- ルートロガーへのログハンドラーの追加
- 次の構文で
add-handler操作を使用します。HANDLER は追加するログハンドラーの名前です。/subsystem=logging/root-logger=ROOT:add-handler(name="HANDLER")
ログハンドラーを作成してから、ログハンドラーをルートロガーへ追加する必要があります。例14.1 ルートロガーの add-handler 操作
[standalone@localhost:9999 /] /subsystem=logging/root-logger=ROOT:add-handler(name="FILE") {"outcome" => "success"} - ルートロガーの設定内容の表示
- 次の構文で
read-resource操作を使用します。/subsystem=logging/root-logger=ROOT:read-resource
例14.2 ルートロガーの read-resource 操作
[standalone@localhost:9999 /] /subsystem=logging/root-logger=ROOT:read-resource { "outcome" => "success", "result" => { "filter" => undefined, "filter-spec" => undefined, "handlers" => [ "CONSOLE", "FILE" ], "level" => "INFO" } } - ルートロガーのログレベルの設定
- 次の構文で
write-attribute操作を使用します。LEVEL はサポートされているログレベルの 1 つです。/subsystem=logging/root-logger=ROOT:write-attribute(name="level", value="LEVEL")
例14.3 ルートロガーの write-attribute 操作によるログレベルの設定
[standalone@localhost:9999 /] /subsystem=logging/root-logger=ROOT:write-attribute(name="level", value="DEBUG") {"outcome" => "success"} - ルートロガーからのログハンドラーの削除
- 次の構文で
remove-handlerを使用します。HANDLER は削除するログハンドラーの名前です。/subsystem=logging/root-logger=ROOT:remove-handler(name="HANDLER")
例14.4 ログハンドラーの削除
[standalone@localhost:9999 /] /subsystem=logging/root-logger=ROOT:remove-handler(name="FILE") {"outcome" => "success"}

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.