Bunnyx.Logging (Bunnyx v0.3.0)

Copy Markdown View Source

CDN access logs and origin error logs.

CDN logs are raw pipe-separated text with one line per request. Origin error logs are JSON with structured error data.

Both use separate base URLs from the main API but authenticate with the same account API key.

Usage

client = Bunnyx.new(api_key: "sk-...")

{:ok, log_text} = Bunnyx.Logging.cdn(client, 12345, ~D[2025-06-01])
{:ok, errors} = Bunnyx.Logging.origin_errors(client, 12345, ~D[2025-06-01])

Summary

Functions

Downloads CDN access logs for a pull zone on a given date.

Downloads origin error logs for a pull zone on a given date.

Functions

cdn(client, pull_zone_id, date)

@spec cdn(Bunnyx.t() | keyword(), pos_integer(), Date.t() | String.t()) ::
  {:ok, String.t()} | {:error, Bunnyx.Error.t()}

Downloads CDN access logs for a pull zone on a given date.

Returns raw pipe-separated log text. Logs have a 3-day retention window.

The date can be a Date struct or a string in "MM-DD-YY" format.

origin_errors(client, pull_zone_id, date)

@spec origin_errors(Bunnyx.t() | keyword(), pos_integer(), Date.t() | String.t()) ::
  {:ok, term()} | {:error, Bunnyx.Error.t()}

Downloads origin error logs for a pull zone on a given date.

Returns parsed JSON with structured error data.

The date can be a Date struct or a string in "MM-dd-yyyy" format.