Changing log placement
Last updated 2021-06-15
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:
- Format Version Default puts the log statement in
vcl_log
if the logging endpoint is using version 2 log format. If the logging endpoint is using version 1 log format, puts the log statement invcl_deliver
. - waf debug (
waf_debug_log
) puts the log statement inwaf_debug_log
, which allows for logging of WAF 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.
Using the web interface to change log placement
Follow these instructions to update a logging endpoint's VCL placement using the web interface:
- Log in to the Fastly web interface.
- From the Home page, select the appropriate service. You can use the search box to search by ID, name, or domain.
- Click the Edit configuration button and then select the option to clone the active version. The Domains page appears.
Click the Logging link. The Logging endpoints page appears.
Click the name of the logging endpoint you want to edit. The Edit this endpoint page appears.
In the Placement section, select a placement for the logging endpoint.
Click the Update button.
- 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 invcl_log
. Logging endpoints using version 1 log format are placed invcl_deliver
.waf_debug
puts the log statement in thewaf_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' 'https://api.fastly.com/service/<your Fastly service ID>/version/<version_id>/logging/<logging_integration>/<logging_name>' --data-binary '{"placement":"none"}'
Do not use this form to send sensitive information. If you need assistance, contact support.