Changing log placement

Fastly's Real-Time Log Streaming feature allows you to specify where the logging call should be placed in the generated VCL.

Available log placement options

You can choose one of the following log placement options:

Using the web interface to change log placement

Follow these instructions to update a logging endpoint's VCL placement using the web interface:

  1. Log in to the Fastly web interface.
  2. From the Home page, select the appropriate service. You can use the search box to search by ID, name, or domain.
  3. Click the Edit configuration button and then select the option to clone the active version. The Domains page appears.
  4. Click the Logging link. The Logging endpoints page appears.

  5. Click the name of the logging endpoint you want to edit. The Edit this endpoint page appears.

  6. In the Placement section, select a placement for the logging endpoint.

    Logging placement options

  7. Click the Update button.

  8. Click the Activate button to deploy your configuration changes.

Using the API to change log placement

You can use the API to update a logging endpoint's VCL placement. The API provides a placement field for specifying where in the generated VCL the logging call should be placed. It can be one of the following:

  • "" uses the default version placement when not set. Logging endpoints using version 2 log format are placed in vcl_log. Logging endpoints using version 1 log format are placed in vcl_deliver.
  • waf_debug puts the log statement in the waf_debug_log subroutine, which allows for logging of WAF-specific variables.
  • none prevents the log statement from being rendered in VCL. Use this option if you intend to write a log statement manually in custom VCL.

For example, to update the logging placement to none, the curl command would look like this:

$ curl -X PUT -H 'Fastly-Key: FASTLY_API_TOKEN' -H 'Content-Type: application/json' '<your Fastly service ID>/version/<version_id>/logging/<logging_integration>/<logging_name>' --data-binary '{"placement":"none"}'
Was this guide helpful?

Do not use this form to send sensitive information. If you need assistance, contact support.