aws-cw-logger
v1.0.3
Published
Put log event to aws cloudwatch in sequence.
Downloads
7
Readme
aws cw logger
Put log event to aws cloudwatch in sequence.
Install
$ npm i -S aws-cw-logger
Before usage
create your own your-config-file.json
{
"accessKeyId": "yourAccessKeyId",
"secretAccessKey": "yourSecretAccessKey",
"region": "yourRegion"
}
Usage
const cw = require('aws-cw-logger');
cw.configure('your-config-file.json', {
apiVersion: '2014-03-28', // default
logGroupName: 'yourLogGroupName',
logStreamNamePrefix: 'yourStreamNamePrefix'
});
cw.pushLog({
event: 'test1'
});
cw.pushLog({
event: 'test2'
});
setTimeout(() => {
cw.pushLog({
event: '10s'
})
}, 1000);
TODO
- After pulished, add cb
- More configurable params