BunnyCDN Support Hub

Guides, troubleshooting and support requests to help you get started with BunnyCDN.

How do I download my logs via the API?

Please note: The logging API is a work-in-progress, we are releasing this guide now so that you can begin to obtain logs via the API. 

You can programatically download your BunnyCDN 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 POST request to our logging service, which will reply with the logs that you request. The URL you need to send the post 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://bunnycdn.com/dashboard/pullzones/edit/60367 then my ID is 60367. For example, if I wanted to request the logs for the 20th of May 2018, for a Pull Zone ID of 60637, my URL would be:

https://logging.bunnycdn.com/05-20-18/60367.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 here.

In addition, you can send an Accept-Encoding: gzip header in order to get a GZip encoded stream back for faster download.

 

2 Comments

  • 0
    Avatar
    Radoslaw Wasiuk

    Hi,

    Is it possible to download logs older than 3 days?
    Because when I'm trying to do this I'm receiving: "No logs are currently found for this time range"

    Regards,

  • 0
    Avatar
    Dejan Grofelnik Pelzel

    Hi Radoslaw,

    Sorry for a bit of a delayed reply. Unfortunately not at the moment. Logging is currently limited to 3 days, but it's something we hope to add in the future.

    Regards,

    Dejan

Please sign in to leave a comment.