11.3.7. CLI での非同期ログハンドラーの設定
非同期ログハンドラーは、CLI で追加、削除、および編集できます。
非同期ログハンドラーを設定するために実行するタスクは以下のとおりです。
- 非同期ログハンドラーの設定の表示
- 新しい非同期ログハンドラーの追加
- ログレベルの変更
- キューの長さの設定
- オーバーフローアクションの設定
- サブハンドラーの追加
- サブハンドラーの削除
- 非同期ログハンドラーの削除
これらの各タスクについては以下で説明されています。
- 非同期ログハンドラーの設定の表示
- 次の構文で
read-resource
操作を使用します。/subsystem=logging/async-handler=HANDLER:read-resource
HANDLER をログハンドラーの名前に置き換えます。例11.50
[standalone@localhost:9999 /] /subsystem=logging/async-handler=NFS_LOGS:read-resource { "outcome" => "success", "result" => { "encoding" => undefined, "filter" => undefined, "formatter" => "%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n", "level" => undefined, "overflow-action" => "BLOCK", "queue-length" => "50", "subhandlers" => undefined } } [standalone@localhost:9999 /]
- 新しい非同期ログハンドラーの追加
- 次の構文で
add
操作を使用します。/subsystem=logging/async-handler=HANDLER:add(queue-length="LENGTH")
HANDLER をログハンドラーの名前と置き換えます。LENGTH を、キューに保持できるログ要求の最大数と置き換えます。例11.51
[standalone@localhost:9999 /] /subsystem=logging/async-handler=NFS_LOGS:add(queue-length="10") {"outcome" => "success"} [standalone@localhost:9999 /]
- ログレベルの変更
- 次の構文で
change-log-level
操作を使用します。/subsystem=logging/async-handler=HANDLER:change-log-level(level="LEVEL")
HANDLER をログハンドラーの名前と置き換えます。LEVEL を、設定するログレベルと置き換えます。例11.52
[standalone@localhost:9999 /] /subsystem=logging/async-handler=NFS_LOGS:change-log-level(level="INFO") {"outcome" => "success"} [standalone@localhost:9999 /]
- キューの長さの設定
- 次の構文で
write-attribute
操作を使用します。/subsystem=logging/async-handler=HANDLER:write-attribute(name="queue-length", value="LENGTH")
HANDLER をログハンドラーの名前と置き換えます。LENGTH を、キューに保持できるログ要求の最大数と置き換えます。この変更を反映するには、JBoss Enterprise Application Platform 6 を再起動する必要があります。例11.53
[standalone@localhost:9999 /] /subsystem=logging/async-handler=NFS_LOGS:write-attribute(name="queue-length", value="150") { "outcome" => "success", "response-headers" => { "operation-requires-reload" => true, "process-state" => "reload-required" } } [standalone@localhost:9999 /]
- オーバーフローアクションの設定
- 次の構文で
write-attribute
操作を使用します。/subsystem=logging/async-handler=HANDLER:write-attribute(name="overflow-action", value="ACTION")
HANDLER をログハンドラーの名前と置き換えます。ACTION を DISCARD または BLOCK と置き換えます。例11.54
[standalone@localhost:9999 /] /subsystem=logging/async-handler=NFS_LOGS:write-attribute(name="overflow-action", value="DISCARD") {"outcome" => "success"} [standalone@localhost:9999 /]
- サブハンドラーの追加
- 次の構文で
assign-subhandler
操作を使用します。/subsystem=logging/async-handler=HANDLER:assign-subhandler(name="SUBHANDLER")
HANDLER をログハンドラーの名前と置き換えます。SUBHANDLER を、この非同期ハンドラーのサブハンドラーとして追加するログハンドラーの名前と置き換えます。例11.55
[standalone@localhost:9999 /] /subsystem=logging/async-handler=NFS_LOGS:assign-subhandler(name="NFS_FILE") {"outcome" => "success"} [standalone@localhost:9999 /]
- サブハンドラーの削除
- 次の構文で
unassign-subhandler
操作を使用します。/subsystem=logging/async-handler=HANDLER:unassign-subhandler(name="SUBHANDLER")
HANDLER をログハンドラーの名前と置き換えます。SUBHANDLER を、削除するサブハンドラーの名前と置き換えます。例11.56
[standalone@localhost:9999 /] /subsystem=logging/async-handler=NFS_LOGS:unassign-subhandler(name="NFS_FILE") {"outcome" => "success"} [standalone@localhost:9999 /]
- 非同期ログハンドラーの削除
- 次の構文で
remove
操作を使用します。/subsystem=logging/async-handler=HANDLER:remove
HANDLER をログハンドラーの名前に置き換えます。例11.57
[standalone@localhost:9999 /] /subsystem=logging/async-handler=NFS_LOGS:remove {"outcome" => "success"} [standalone@localhost:9999 /]