Nodejs logging to CloudWatch Logs made easy
- Creates Log Groups automatically
- Creates Log Streams automatically
- Periodic upload
- Automatic log batching
- JSON logging support
- logger instances are shared across modules
npm install lawgs
How to use it
The only required configurations are the AWS configurations.
var lawgs = ;lawgs;
If you are using roles, you will need the following roles:
Simply create your logger and you are ready to go.
var logger = lawgs; /* LogGroup */logger;
example.js for a full working example.
Running the example, you get the following output:
Disposed subscription Resubscribed SuperbowlLogs >> uploadQueuedLogs triggered with 2 logs Checking if log group exists: SuperbowlLogs Creating log group: SuperbowlLogs Checking if log stream exists: error Checking if log stream exists: touchdown Creating log stream: error Creating log stream: touchdown Uploading logs Uploading logs Logs uploaded Logs uploaded
- S3 logs archiving
Feel free to open issues and open pull requests.
Lambdaws (AWS Lambda Wrapper)
Superbowl Notifier (Used Lawgs to log high-volume tweets)