6.6. Service Registry ロギングの設定
実行時に Service Registry のログを設定できます。Service Registry は、詳細なロギングのために特定のロガーのログレベルを設定する REST エンドポイントを提供します。このセクションでは、Service Registry /admin REST API を使用して、実行時に Service Registry ログレベルを表示および設定する方法を説明します。
前提条件
-
Service Registry インスタンスにアクセスするための URL を取得するか、OpenShift にデプロイした場合に Service Registry ルートを取得します。この簡単な例では、
localhost:8080の URL を使用しています。
手順
この
curlコマンドを使用して、ロガーio.apicurio.registry.storageの現在のログレベルを取得します。curl -i localhost:8080/apis/registry/v2/admin/loggers/io.apicurio.registry.storage
$ curl -i localhost:8080/apis/registry/v2/admin/loggers/io.apicurio.registry.storage HTTP/1.1 200 OK [...] Content-Type: application/json {"name":"io.apicurio.registry.storage","level":"INFO"}Copy to Clipboard Copied! Toggle word wrap Toggle overflow この
curlコマンドを使用して、ロガーio.apicurio.registry.storageのログレベルをDEBUGに変更します。curl -X PUT -i -H "Content-Type: application/json" --data '{"level":"DEBUG"}' localhost:8080/apis/registry/v2/admin/loggers/io.apicurio.registry.storage$ curl -X PUT -i -H "Content-Type: application/json" --data '{"level":"DEBUG"}' localhost:8080/apis/registry/v2/admin/loggers/io.apicurio.registry.storage HTTP/1.1 200 OK [...] Content-Type: application/json {"name":"io.apicurio.registry.storage","level":"DEBUG"}Copy to Clipboard Copied! Toggle word wrap Toggle overflow この
curlコマンドを使用して、ロガーio.apicurio.registry.storageのログレベルをデフォルト値に戻します。curl -X DELETE -i localhost:8080/apis/registry/v2/admin/loggers/io.apicurio.registry.storage
$ curl -X DELETE -i localhost:8080/apis/registry/v2/admin/loggers/io.apicurio.registry.storage HTTP/1.1 200 OK [...] Content-Type: application/json {"name":"io.apicurio.registry.storage","level":"INFO"}Copy to Clipboard Copied! Toggle word wrap Toggle overflow