pino-https-aws-signed-requests
v1.0.0
Published
Fork of @technicallyjosh/pino-http-send for handling sending logs in HTTPS through AWS Signed requests.
Downloads
1
Maintainers
Readme
pino-https-aws-signed-requests
A basic handler for pino logs that sends batches to a desired endpoint via AWS signed requests, forked from @technicallyjosh/pino-http-send repository.
Installation
$ npm i pino-https-aws-signed-requests
API
You can use this module as a pino destination.
This will use the same batching function like the CLI usage. If the batch length
is not reached within a certain time (timeout
), it will auto "flush".
createWriteStream
The options passed to this follow the same values as the CLI defined above.
| Property | Type | Required/Default |
| --------------------- | ----------------------- | ---------------- |
| elkRole | string
| REQUIRED |
| elkDomain | string
| REQUIRED |
| elkIndex | string
| REQUIRED |
| batchSize | number
| 10 |
| timeout | number
| 5000 |
const {createWriteStream} = require('../pino-https-aws-signed');
const stream = createWriteStream({
elkRole: process.env.ROLE,
elkDomain: process.env.ES_DOMAIN,
elkIndex: process.env.ELK_INDEX,
});
const logger = Pino(
{
level: 'info',
},
stream,
);