I had a use case where I wanted to investigate various logs and their types; mostly to group and count error instances. I see there is both pagination and checkpoint styles in retrieving logs - https://auth0.com/docs/deploy-monitor/logs/retrieve-log-events-using-mgmt-ap.
With pagination, you’re only able to retrieve up to a certain number of pages of results which is fine. When you’re looking to get a larger set, it looks like we should retrieve by checkpoint. As I understand it, you use checkpoint mode by giving from
and take
params as referenced in the above link.
I attempted both of these styles with the node auth0 lib’s getLogs
method - https://auth0.github.io/node-auth0/module-management.ManagementClient.html#getLogs
First, the docs don’t actually mention from
and take
but they are supported. This is just a minor feedback item. The more pressing issue I have is that when working with the checkpoint style, the result is only the body contents which is an array of logs for the given checkpoint instance. As I read the docs, the client is expected to receive a Link
http header which would give the url for the next checkpoint of results.
Unfortunately, the node lib doesn’t expose this to the consumer and so I can’t retrieve the next set of logs. My expectation would have been the result of a call to getLogs({from: "my_first_log_id", take:100})
would be a wrapper object with some metadata including this Link
header along with the result body. The client would then be expected to make a subsequent call to something like getLogCheckpoint(link)
.
Alternatively, there could be a convenience method for getAllCheckpointLogs
where the auth0 lib implements the fetches and returns a full in memory array (for better or for worse.)
I also understand there is a logStream capability, but for the moment I am doing this more for off hand investigations rather than wanting to hook this up to a full blown log aggregation service.