1.0.2 • Published 7 years ago

smallorange-cloudwatch-logger v1.0.2

Weekly downloads
2
License
ISC
Repository
github
Last release
7 years ago

CircleCI

Small Orange Cloudwatch Logger

##Compatible with just Node 7!!!!!!

Small helper to log into AWS Cloudwatch

Features

  • Creates Log Groups automatically
  • Creates Log Streams automatically
  • Automatic log batching
  • JSON logging support
  • Error logging support

Usage

	const AWS = require('aws-sdk');
	const Logger = require('smallorange-cloudwatch-logger');

	AWS.config.update({
		accessKeyId: '{accessKeyId}',
		secretAccessKey: '{secretAccessKey}',
		region: '{region}'
	});

	const cloudWatchLogsClient = new AWS.CloudWatchLogs();
	const logger = new Logger({
		client: cloudWatchLogsClient,
		logGroupName: 'specGroup',
		debounceTime: 5000 // time to accumulate logs before write logs into CW
	});

	logger.log('test');
	logger.log(new Error('error'));
	logger.log({
		test: 'test'
	});

Final Words

If you have any questions, contact me at felipe@smallorange.co.