logging.BinaryLogger.toHTTP()
Description
Adds output to an HTTP endpoint.
Syntax
logger.toHTTP(url)logger.toHTTP(url,{method,headers: { ...headers },batch: {size,vacancy,interval,},tls: {certificate: {cert,key,},trusted: [ ...trustedCerts ],},})
Parameters
toHTTP(url, options?)
urloptions?
URL to send log to.
Options including:
- method - HTTP request method. Default is "POST".
- headers - An object of key-value pairs for HTTP header items.
- batch - Batching settings.
- batch.size - Number of log items in each batch.
- batch.vacancy - Percentage of spare space letf in the internal storage of packed Data object. Default is 0.5.
- batch.interval - Maximum time to wait before outputting a batch even if the number of messages is not enough. Can be a number in seconds or a string with one of the time unit suffixes such as s, m or h. Default is 5 seconds.
- tls - Optional TLS settings if using HTTPS.
- tls.certificate - An object containing cert and key, where cert can be a crypto.Certificate or a crypto.CertificateChain and key must be a crypto.PrivateKey.
- tls.trusted - An array of crypto.Certificate objects for allowed client certificates.
Return Value
The same logger object.