Logging purge requests

      Last updated November 06, 2019

    If you've set up remote log streaming, you can log URL purge requests by adding the following VCL to the vcl_recv subroutine. For example:

    1
    2
    3
    
    if (req.method == "FASTLYPURGE") {
      log {"syslog req.service_id <log name> :: "} "event=purge"" service="req.service_id;
    }
    

    The log name must match the name of your logging endpoint in the Fastly web interface.

    You can add the VCL via custom VCL or VCL Snippets.

    Back to Top

    Additional resources: