バイナリ情報をログする方法
バイナリ情報のログを記録し、フォルダ、ログまたはコネクタに送信できます。
各オプションに、以下を application.yml に追加する必要があります。
ol:
#Logging the request/response sent to the Backend#
debug:
internal:
type: # the type of the log
encoding: CP037
フォルダへのログバイナリ情報の送信:
以下を API プロジェクト application.yml に追加します。
ol:
#Logging the request/response sent to the Backend#
debug:
internal:
type: folder
encoding: CP037
folder: C:\logs # the folder's path
API ファーストコール後に、バイナリ入力および出力で定義したパスにログと命名されたフォルダがあります。
2. ログへのログバイナリ情報の送信
以下を API プロジェクト application.yml に追加します。
ol:
#Logging the request/response sent to the Backend#
debug:
internal:
type: log
encoding: CP037
各 API コール後、コンソールにバイナリ情報ログが表示されます。
3. コネクタへのログバイナリの送信:
ol.debug.internal.type でリクエストコンテキストを設定できるようになりました。Spring の org.springframework.web.context.request.RequestContextHolder を使用して、リクエストおよび応答デバッグ情報を格納します。
何も初期化されなかった場合は、タイプ org.openlegacy.impl.debug.impl.http.InternalDebugHolder または null のオブジェクトが指定されます。例外の場合、または設定されたポイントへ到達しなかった場合(例えば、サポートするプロバイダ上に doAction がなかった場合)、およびプロバイダからすべてのデバッグリクエスト応答ペアにアクセスできる場合(org.openlegacy.impl.debug.impl.http.RequestResponseHolder)。
コネクタへのログバイナリの送信方法:
以下を SDK プロジェクトのアプリケーション yml に追加します。
ol:
#Logging the request/response sent to the Backend#
debug:
internal:
type: request-context
encoding: CP037
API のコンテキストを取得するには、以下をサービス impl に追加します。 :
· RequestContextHolder.currentRequestAttributes().getAttribute(RequestContextInternalDebug.INTERNAL_DEBUG_HOLDER_NAME, RequestAttributes.SCOPE_REQUEST)