Logging API
The logging service provides an easy to use API endpoint for downloading the raw log files.
Logging endpoint
The logging API service is available at logging.bunnycdn.com. To access the log file, you need to send the request with the URL path as described below.
https://logging.bunnycdn.com/{mm}-{dd}-{yy}/{pull_zone_id}.log
Authentication
The logging API works with a basic AccessKey header authentication. To authenticate a request, you need to send your account API key through the AccessKey header.
AccessKey: bce1fd5a-a1da-464f-955e-9295201134f5
Compression
By default, the raw logs are returned in the raw text format. Due to the amount of data required, this can present a significantly large file size. To reduce the size of the download and greatly improve the performance of the download, you can use the Accept-Encoding header to signal our service that the data can be compressed using GZip. This can decrease the file size and download time by as much as 5 times.
Accept-Encoding: gzip
Complete example
Below is a complete example code to download a log file from the bunny.net logging service.
curl --location \
--request GET 'https://logging.bunnycdn.com/03-13-24/60367.log' \
--header 'AccessKey: bce1fd5a-a1da-464f-955e-9295201134f5'
Additional parameters
On top of the basic download service, the logging API provides an additional set of query-based parameters to control the delivery of the data.
start (number)
The start parameter defines the number of log lines that will be skipped at the beginning of the file before starting the output.
end (number)
The end parameter defines the end index of the log lines that will be processed during the output.
sort (string)
By default, the logs are arranged from latest to oldest. The sort parameter defines the order in which the log file will be returned. Possible values: asc, desc (default).
Updated 7 months ago