Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
awslogs-stream
Advanced tools
#awslogs-stream
Stream to write logs to AWS CloudWatch.
This is actually a plain Node.js Writable object stream.
##Usage
var bunyan = require('bunyan');
var CloudWatchStream = require('awslogs-stream');
var stream = CloudWatchStream({
logGroupName: 'my-group',
logStreamName: 'my-stream',
cloudWatchLogsOptions: {
region: 'us-west-1'
},
processLogRecord: function(record) {
return {
message: JSON.stringify(record),
timestamp: 1*new Date(record.time)
}
}
});
var log = bunyan.createLogger({
name: 'foo',
streams: [
{
stream: stream,
type: 'raw'
}
]
});
##API
###CloudWatchStream(opts)
With opts
of:
logGroupName
(required)logStreamName
(required)cloudWatchLogsOptions
(optional): options passed to the AWS.CloudWatchLogs
constructorcloudWatchLogs
(optional): optional existing cloudwatchlogs clientprocessLogRecord
(optional): function to process log records to for cloudwatch (it should return object with 2 properties: message
to be string and timestamp
to be unix timestamp)bufferDuration
(optional, by default it is 5000 ms) timeout between writesOn 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 logs##Contributors This project was created by Mirko Kiefer (@mirkokiefer) and almost rewritten by Denis Bardadym.
FAQs
Writable stream to publish logs to AWS CloudWatch Logs
The npm package awslogs-stream receives a total of 255 weekly downloads. As such, awslogs-stream popularity was classified as not popular.
We found that awslogs-stream 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.