When streaming log entries to our own custom logging system, it should be possible to capture all the same information that is available in the log viewer in the Auth0 management portal. Currently there is a functionality gap with log streaming (at least for a custom webhook stream which is what I am using): the details of any custom actions that were executed as part of an event. These details should be included in the data sent to the log stream.
What we get in the log stream data for executed actions looks like this: "actions": { "executions": ["random_unique_identifier"] },
- in other words it is a pointer to the action execution log, not the data itself. This should be replaced with all the data available for the action execution, which looks like this:
{
"action_name": "My action name",
"response": {
"logs": "Custom data written to console.log by our code...",
"stats": {
"total_request_duration_ms": 414,
"total_runtime_execution_duration_ms": 411,
"runtime_processing_duration_ms": 4,
"action_duration_ms": 345,
"runtime_external_call_duration_ms": 62,
"boot_duration_ms": 66,
"network_duration_ms": 3
}
},
"started_at": "2022-04-28T11:07:08.986801291Z",
"ended_at": "2022-04-28T11:07:09.402169426Z"
}
Actions are extremely useful, but diagnosing unexpected behaviour in them in production scenarios is currently painful, because simply finding the relevant log entry in your user interface is quite a challenge and you can only look at one at a time, so can’t find patterns in the data. Allowing us to import our own custom log data from console.log writes in an action to a custom logging environment (ElasticSearch in my case), would make it much easier to work with actions in production.