Message Logging
BC OnLine Account API Gateway message logging is configured by account ID and Gateway API. The combination of Gateway environment, account ID, and API name is used to create a unique log name.
The API Gateway uses Google Cloud Platform (GCP) logging. With GCP logging, messages can be written (archived) to either CloudStorage Buckets or BigQuery Tables. For each account log name, a Bucket or Table is created to contain the account log messages.
BC Registries owns and maintains the account log storage Buckets and Tables. To enable the viewing of Gateway message logs, the account must have a GCP account and provide BC Registries with a GCP project ID. As part of the account message logging setup, BC Registries will grant the account project ID permission to view the message log Bucket or Table.
Log Entry Example
Below is a JSON formatted extract for a single message log entry for account ID PS91871 and the PPR API. The extract is from the GCP Log Viewer console. The timestamp and all the jsonPayload content are captured in the account message log archive: written to either a CloudStorage Bucket or a BigQuery Table.
{
"insertId": "1nnu8l0g1ztow2v",
"jsonPayload": {
"accountId": "PS91871",
"method": "POST",
"requestPayload": "{ \"type\": \"INDIVIDUAL_DEBTOR\", \"criteria\": { \"debtorName\": { \"first\": \"James\", \"last\": \"Smith\" } }, \"clientReferenceId\": \"A-00000402\"}",
"messageId": "rrt-658111192331620231-c-gce-12913-20236244-1",
"responsePayload": "{ \"searchId\": \"1294372\", \"searchDateTime\": \"2020-05-15T21:08:32Z\", \"searchQuery\": { \"type\": \"INDIVIDUAL_DEBTOR\", \"criteria\": { \"debtorName\": { \"first\": \"James\", \"last\": \"Smith\" } }, \"limitStartDate\": \"2019-10-15\", \"clientReferenceId\": \"A-00000402\" }, \"results\": [ { \"matchType\": \"EXACT\", \"baseRegistrationNumber\": \"023001B\", \"createDateTime\": \"2020-02-21T18:56:20Z\", \"registrationType\": \"SA\", \"debtor\": { \"personName\": { \"first\": \"James\", \"last\": \"Smith\" } } }, { \"matchType\": \"SIMILAR\", \"baseRegistrationNumber\": \"023320B\", \"createDateTime\": \"2020-01-15T10:12:20Z\", \"registrationType\": \"SA\", \"debtor\": { \"personName\": { \"first\": \"Jim\", \"last\": \"Smith\" } } } ], \"payment\": { \"receipt\": \"/api/v1/payment-requests/2198744/receipts\", \"invoiceId\": \"2198744\" }}",
"statusCode": "201",
"userName": "test-pro-1",
"requestPath": "/ppr/api/v1/searches"
},
"resource": {
"type": "global",
"labels": {
"project_id": "apigw-logging-test"
}
},
"timestamp": "2020-08-13T17:15:27.092912415Z",
"logName": "projects/apigw-logging-test/logs/test-ppr-PS91871-log",
"receiveTimestamp": "2020-08-13T17:15:27.092912415Z"
}
Outstanding
- The data retention period for account message logs.
- Whether to use CloudStorage or BigQuery to archive account message logs.
- What to charge for account message log storage.