Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
bunyan-cloudwatch
Advanced tools
Stream to write bunyan logs to AWS CloudWatch.
This is actually a plain Node.js Writable object stream so could be used without bunyan.
var bunyan = require('bunyan');
var createCWStream = require('bunyan-cloudwatch');
var stream = createCWStream({
logGroupName: 'my-group',
logStreamName: 'my-stream',
cloudWatchLogsOptions: {
region: 'us-west-1'
}
});
var log = bunyan.createLogger({
name: 'foo',
streams: [
{
stream: stream,
type: 'raw'
}
]
});
To avoid raising exceptions when stringifying circular object logs, install the optional dependency 'safe-json-stringify'.
Avoid logging from multiple sources to the same CloudWatch log stream. The module has a fallback by requesting the latest log sequence but this can result in a major performance decrease due to additional requests. It is recommended to e.g. add the machines IP address to the log stream name when logging from multiple instances.
With opts
of:
logGroupName
(required)logStreamName
(required)cloudWatchLogsOptions
(optional): options passed to the AWS.CloudWatchLogs
constructorOn write of the first log, the module creates the logGroup and logStream if necessary.
We use the aws-sdk to write the logs - the AWS credentials have therefore to be configured using environment variables (AWS_ACCESS_KEY_ID
and AWS_SECRET_ACCESS_KEY
).
CloudWatchLogs.putLogEvents
is the method we use to write logsThis project was created by Mirko Kiefer (@mirkokiefer).
FAQs
Writable stream to write bunyan logs to AWS CloudWatch
The npm package bunyan-cloudwatch receives a total of 1,342 weekly downloads. As such, bunyan-cloudwatch popularity was classified as popular.
We found that bunyan-cloudwatch demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.