Class for creating Fastly Named Loggers.
Note: Can only be used when processing requests, not during build-time initialization.
In this example we have a create a logger named 'splunk' and logs the incoming request method and destination.
async function app (event) { let logger = new Logger("splunk"); logger.log(JSON.stringify({ method: event.request.method, url: event.request.url }));
return new Response('OK'); }
addEventListener("fetch", event => event.respondWith(app(event)));
```
Creates a new Logger instance for the given named log endpoint.
Send the given message, converted to a string, to this Logger instance's endpoint
Generated using TypeDoc
Class for creating Fastly Named Loggers.
Note: Can only be used when processing requests, not during build-time initialization.
Example
In this example we have a create a logger named 'splunk' and logs the incoming request method and destination.