11.3. CLI でのロギング設定
11.3.1. CLI での root ロガー設定
root ロガーの設定は CLI を使用して確認/編集することができます。
手順11.1 root ロガーの設定内容の表示
- 次の構文で
read-resource
オペレーションを使用します。/subsystem=logging/root-logger=ROOT:read-resource
例11.1 root ロガーの read-resource オペレーション
[standalone@localhost:9999 /] /subsystem=logging/root-logger=ROOT:read-resource { "outcome" => "success", "result" => { "filter" => {"match" => "names"}, "handlers" => [ "CONSOLE", "FILE" ], "level" => "INFO" } }
手順11.2 root ロガーのログレベルの設定
- 次の構文で
write-attribute
オペレーションを使用します。LEVEL はサポートされているログレベルの 1 つです。/subsystem=logging/root-logger=ROOT:write-attribute(name="level", value="LEVEL")
例11.2 root ロガーの write-attribute オペレーションによるログレベルの設定
[standalone@localhost:9999 /] /subsystem=logging/root-logger=ROOT:write-attribute(name="level", value="DEBUG") {"outcome" => "success"} [standalone@localhost:9999 /]
手順11.3 root ロガーへの log ハンドラーの追加
- 次の構文で
root-logger-assign-handler
オペレーションを使用します。HANDLER は追加するログハンドラーの名前です。/subsystem=logging/root-logger=ROOT:root-logger-assign-handler(name="HANDLER")
ログハンドラーは、root ロガーに追加する前に作成済みである必要があります。例11.3 root ロガーの root-logger-assign-handler オペレーション
[standalone@localhost:9999 /] /subsystem=logging/root-logger=ROOT:root-logger-assign-handler(name="AccountsNFSAsync") {"outcome" => "success"} [standalone@localhost:9999 /]
手順11.4 root ロガーからのログハンドラーの削除
- 次の構文で
root-logger-unassign-handler
を使用します。HANDLER は削除するログハンドラーの名前です。/subsystem=logging/root-logger=ROOT:root-logger-unassign-handler(name="HANDLER")
例11.4
[standalone@localhost:9999 /] /subsystem=logging/root-logger=ROOT:root-logger-unassign-handler(name="AccountsNFSAsync") {"outcome" => "success"} [standalone@localhost:9999 /]