fused.api.log -- Audit Logs
fused.api.log() retrieves audit logs for UDF executions. Every time a UDF runs, the system records metadata about the execution including which UDF ran, who ran it, how long it took, and any stdout/stderr output.
Function Signature
# doctest: skip
fused.api.log(
id: str | None = None,
*,
udf_id: str | None = None,
udf_name: str | None = None,
shared_token: str | None = None,
exec_env: bool = False,
distinct: bool = False,
distinct_type: Literal["names", "ids"] | None = None,
start_timestamp: str | None = None,
end_timestamp: str | None = None,
limit: int = 100,
scan_forward: bool = True,
page_token: str | None = None,
max_records_to_scan: int = 1000,
) -> dict[str, Any]
Parameters
Filters
Only one of id, udf_id, udf_name, or shared_token may be specified. If none are provided, logs for the authenticated user are returned.
| Parameter | Type | Default | Description |
|---|---|---|---|
id | str | None | None | Fetch a single audit log record by its unique ID. When set, all other filters are ignored. |
udf_id | str | None | None | Filter logs by the UDF's unique ID (UUID). |
udf_name | str | None | None | Filter logs by UDF slug/name. |
shared_token | str | None | None | Filter logs by shared token (for UDFs accessed via shared links). |
exec_env | bool | False | If True, scope logs to the authenticated user's execution environment rather than their user email. Useful for team/org-level queries. |
Distinct Queries
| Parameter | Type | Default | Description |
|---|---|---|---|
distinct | bool | False | If True, return one record per unique UDF (deduplicated), keeping the most recent execution for each. Requires distinct_type. |
distinct_type | "names" | "ids" | None | None | When distinct=True: "names" deduplicates by udf_name, "ids" deduplicates by udf_id. |