1.0.5 • Published 5 months ago
cloudwatch-logger-npm v1.0.5
CloudWatch Logger NPM
A simple CloudWatch Logger for Node.js applications.
Installation
npm install cloudwatch-logger-npm
Usage
import { Logger } from 'cloudwatch-logger-npm'
// first argument is the service name
// second argument is the log group name
// third argument is the log stream name
const logger = new Logger('CM', 'TestLogGroup', 'TestLogStream')
logger.error({
message: 'This is a error test log entry.',
traceId: '1234567890',
body: {
test: 'test'
}
})
Configuration
Create a .env
file in the root directory of your project and add the following variables:
AWS_ACCESS_KEY_ID=your-access-key-id
AWS_SECRET_ACCESS_KEY=your-secret-access-key
AWS_REGION=aws-region
License
This project is licensed under the MIT License - see the LICENSE file for details.