Start here

Getting started
Domains & Origins

Domains & Origins
Request settings
Load balancing
Custom VCL
Image optimization

Access Control Lists
Monitoring and testing
Securing communications
Security measures
Web Application Firewall

Logging endpoints
Non-Fastly services

Streaming logs
Debugging techniques
Common errors

Account info
Account management
User access and control


    Changing where log files are written

      Last updated October 23, 2019

    For supported logging endpoints that write files to remote services, Fastly uses a combination of factors to ensure log files aren't overwritten, including:

    To change where log files are written, you can modify the path and timestamp_format variables on select endpoints. The logging system combines the path, timestamp_format, and uid variables to create the file name:


    This guide explains how to use the path and timestamp_format variables to control where log files are written.

    Timestamp format

    You may want to consider changing the timestamp format to remove characters from the log filenames. For example, if you're working with Elastic MapReduce, you might need to remove the colons in the filename.

    The timestamp_format variable is provided as a strftime compatible format. The default format is ISO 8601 Combined Date/Time Format:


    The variables are expanded when the file is created. For example, %Y will be replaced by the current year and %m by the current month number:

    <year>-<2 digit month number>-<2 digit day number>T<hour>:<minute>:<second>

    The timestamp for a file created at midnight on January 1st, 1970 would be 1970-01-01T00:00:00.000.


    The path variable acts differently depending on whether or not it ends in a trailing /.

    If the variable does end in a trailing /, then it's treated as a directory. For example, if the variable is set to my_logs/, the files are written in the directory my_logs. If the variable is set to my_logs without the trailing /, the files are written in the top-level directory and are prefixed with my_logs.

    The two approaches can also be combined. For example, if the variable is set to my_logs/foo, the files are written in the my_logs directory and are prefixed with foo.

    Logs can also be nested. For example, if the variable is set to my_logs/sub_logs/, the files are written in the sub_logs directory in the my_logs directory.

    Directories are created automatically when possible.


    Fastly's logging system automatically adds suffixes to files as appropriate.

    Suffix File type
    .log Plain log file
    .log.gz Gzipped log file
    .log.gpg PGP encrypted log file
    .log.gz.gpg PGP encrypted, Gzipped log file
    Back to Top