Different systems have standardized on different logging formats over time. Fastly believes logging should be as customizable as possible, working with whichever infrastructure you already have in place. This guide details some of the more complicated custom logging strings (e.g., JSON, Key/Value, CSV, and URL-encoded) you can use to implement the logging formats mentioned in the Apache logging module.
Custom Tags to Loggly or RFC5424 to another provider
You’ll have to create a regular Syslog logging object pointing at your endpoint. For example, if Fastly didn't have a Loggly logging object then this would mean setting hostname to logs-01.loggly.com, port to 6514, use_tls to true, and the message format field to blank. Then, in the format field, you would put the following:
log name - this can be whatever you want but we recommend using the same name as you’ve used for the logging object in Fastly.
token - the private token for your RFC5424 endpoint (if sending to Loggly this is your Customer Token).
PEN - this is a Private Enterprise Number. For example the Loggly PEN (Private Enterprise Number) is 41058. If you want to send to another provider then you can look up their PEN on the IANA registry and use that.
tags - these can be any key/value pairs you want. In the example we have two: fastly and other tag
regular format string - this is regular Fastly logging directives, put whatever you want here (for example: the Common Log Format mentioned above).
The examples below demonstrate different representations of the same variables and variable types:
The HTTP protocol version.
The time at the start of the request in seconds.
The time at the start of the request in ISO 8601. format