
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
aws-cwlogger
Advanced tools
This is simple logger to send logs into AWS CloudWatch Logs stream.
const CWLogger = require('aws-cwlogger');
const logger = new CWLogger({
// AWS access
accessKeyId: "XXXXXXXXXXXXXXXXXXXX",
secretAccessKey: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
region: "eu-central-1",
// Logs destination
groupName: "test_group",
streamName: "test_stream"
});
logger.log('Text message');
logger.info({text: 'Supported all data types!'});
logger.warn(['Including'], {_: 'multiple arguments'});
logger.error(false);
logger.cat('category-name').log('Categories supported.');
logger.cat('category-name').info('with');
logger.cat('category-name').warn('all 4');
logger.cat('category-name').error('methods');
After that you should see in console:
Text message
{ text: 'Supported all data types!' }
[ 'Including' ] { _: 'multiple arguments' }
false
<<category-name>>: Categories supported.
<<category-name>>: with
<<category-name>>: all 4
<<category-name>>: methods
And in AWS console - CloudWatch - Logs:
Param | Type | Description |
---|---|---|
enabled | {boolean} | Enable sending logs to CloudWatch (default: true ). Leave the option false to don't save logs into CloudWatch Logs |
accessKeyId* | {string} | AWS API key (not required if enabled === false ) |
secretAccessKey* | {string} | AWS API secret (not required if enabled === false ) |
region* | {string} | AWS region (default: eu-central-1 ) (not required if enabled === false ) |
groupName* | {string} | CloudWatch log group name (not required if enabled === false ) |
streamName* | {string} | CloudWatch log stream name in group (not required if enabled === false ) |
consolePrint | {boolean} | Print errors into console (default: true ) |
flushDelay | {number} | Delay in ms. between sending messages (default: 1000 ) |
maxBatchCount | {number} | Max messages to send in butch (default: 5000) |
maxBatchSize | {number} | The maximum batch size (default: 1000000) |
P.S. IAM user should have permissions for actions
["logs:DescribeLogGroups","logs:DescribeLogStreams","logs:PutLogEvents"]
P.P.S. Do not use root user for the security reasons!
npm install aws-cwlogger --save
cwlogger-test
)test
)cwlogger-test
)With permission:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"logs:DescribeLogGroups",
"logs:DescribeLogStreams",
"logs:PutLogEvents"
],
"Resource": [
"arn:aws:logs:eu-central-1:665544332211:log-group:cwlogger-test:*"
]
}
]
}
Don't forget to replace "Resource" with your ARN.
cp test/config/example.config.js test/config/config.js
nano test/config/config.js
npm install
npm test
MIT
v1.0.1 <small>[2017-10-20]</small>
options.enabled
FAQs
AWS CloudWatch Logger - log events in amazon log stream
The npm package aws-cwlogger receives a total of 0 weekly downloads. As such, aws-cwlogger popularity was classified as not popular.
We found that aws-cwlogger 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
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.