Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@aws-sdk/client-cloudwatch-logs
Advanced tools
AWS SDK for JavaScript Cloudwatch Logs Client for Node.js, Browser and React Native
The @aws-sdk/client-cloudwatch-logs npm package allows developers to interact with the Amazon CloudWatch Logs service. This service provides monitoring, storing, and accessing log files from Amazon EC2 instances, AWS CloudTrail, and other sources. The package enables programmatic access to all the features of CloudWatch Logs, such as creating and managing log groups and streams, sending log events, and querying log data.
Creating a Log Group
This feature allows you to create a new log group in CloudWatch Logs. A log group is a collection of log streams that share the same retention, monitoring, and access control settings.
const { CloudWatchLogsClient, CreateLogGroupCommand } = require('@aws-sdk/client-cloudwatch-logs');
const client = new CloudWatchLogsClient({ region: 'us-west-2' });
const command = new CreateLogGroupCommand({ logGroupName: 'my-log-group' });
client.send(command);
Creating a Log Stream
This feature allows you to create a log stream within a log group. A log stream represents a sequence of log events that share the same source.
const { CloudWatchLogsClient, CreateLogStreamCommand } = require('@aws-sdk/client-cloudwatch-logs');
const client = new CloudWatchLogsClient({ region: 'us-west-2' });
const command = new CreateLogStreamCommand({ logGroupName: 'my-log-group', logStreamName: 'my-log-stream' });
client.send(command);
Putting Log Events
This feature allows you to send log data to a log stream in CloudWatch Logs. Each log event consists of a timestamp and a message.
const { CloudWatchLogsClient, PutLogEventsCommand } = require('@aws-sdk/client-cloudwatch-logs');
const client = new CloudWatchLogsClient({ region: 'us-west-2' });
const command = new PutLogEventsCommand({
logGroupName: 'my-log-group',
logStreamName: 'my-log-stream',
logEvents: [{ timestamp: Date.now(), message: 'This is a log message.' }]
});
client.send(command);
Searching and Filtering Log Data
This feature allows you to search and filter log data within a log group. You can specify a filter pattern, as well as a time range for the search.
const { CloudWatchLogsClient, FilterLogEventsCommand } = require('@aws-sdk/client-cloudwatch-logs');
const client = new CloudWatchLogsClient({ region: 'us-west-2' });
const command = new FilterLogEventsCommand({
logGroupName: 'my-log-group',
filterPattern: 'ERROR',
startTime: Date.now() - 3600000,
endTime: Date.now()
});
client.send(command);
winston-cloudwatch is a transport for the popular logging library winston, which allows you to send your logs to Amazon CloudWatch. Unlike @aws-sdk/client-cloudwatch-logs, which is the official AWS SDK for JavaScript, winston-cloudwatch integrates with the winston logging framework and provides a more streamlined way to log directly from your application.
pino-cloudwatch is a module that streams pino logs to Amazon CloudWatch. Pino is a very low overhead Node.js logger. This package is similar to @aws-sdk/client-cloudwatch-logs in that it allows logging to CloudWatch, but it is specifically designed to work with the pino logging library and focuses on performance.
1.0.0-rc.4 (2020-10-31)
FAQs
AWS SDK for JavaScript Cloudwatch Logs Client for Node.js, Browser and React Native
The npm package @aws-sdk/client-cloudwatch-logs receives a total of 975,685 weekly downloads. As such, @aws-sdk/client-cloudwatch-logs popularity was classified as popular.
We found that @aws-sdk/client-cloudwatch-logs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.