You can programmatically download your bunny.net CDN logs via our API. Logs are pushed out from our worldwide CDN servers to our logging system every 20 seconds, and should generally appear within 30-120 seconds after being generated.
In order to do this, you need to craft a GET request to our logging service, which will reply with the logs that you request. The URL you need to send the get request too is:
https://logging.bunnycdn.com/{mm}-{dd}-{yy}/{pull_zone_id}.log
In this request, mm is the 2 digit number to represent the month, dd is the number day of the month you want logs for, and yy is the year. You also need to put your Pull Zone ID for the pull_zone_id. This is obtainable from the dashboard, by going to your Pull Zone and getting the number out of the URL. For example, if the URL to my Pull Zone is https://dash.bunny.net/cdn/1470331/ then my ID is 1470331. For example, if I wanted to request the logs for the 20th of May 2023, for a Pull Zone ID of 1470331, my URL would be:
https://logging.bunnycdn.com/05-20-23/1470331.log
You will also need to authenticate any requests you send to the logging service. In order to do this, include an HTTP header with the name AccessKey and your API key as the value. Your API key is located at the bottom here.
In addition, you can send an Accept-Encoding: gzip header in order to get a GZip encoded stream back for faster download.