This is a fork from native Datadog logger
Easy to send logs directly to AWS CloudWatch
$ npm install @1xtr/moleculer-cloudwatch-logger --save
// ES5 example
const CloudWatchLogger = require('@1xtr/moleculer-cloudwatch-logger');
// ES6+ example
import { CloudWatchLogger } from '@1xtr/moleculer-cloudwatch-logger';
module.exports = {
logger: new CloudWatchLogger({
// put here your options
})
}
const defaultOptions = {
clientOptions: {},
source: process.env.MOL_NODE_NAME || 'moleculer',
hostname: hostname(),
objectPrinter: null,
interval: 5 * 1000,
excludeModules: [],
logGroupName: `mol-${process.env.MOL_NODE_NAME || hostname()}`,
}
{
"clientOptions": {
"region": "us-east-1"
},
"excludeModules": [
"broker",
"registry",
"discovery",
"transporter",
"$node",
"transit",
"cacher"
]
}