Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
@5app/logger
Advanced tools
Simple console logger that outputs json in prod and pretty messages on dev
npm install --save @5app/logger
Then, generate a logger in your app and use it to log messages.
const getLogger = require('@5app/logger');
const logger = getLogger({
simple: process.env.NODE_ENV === 'development',
metadata: {
tag: process.env.TAG, // release tag, e.g. docker container tag
},
});
logger.info('An email was sent', {
email: 'customer@5app.com',
template: 'template1',
});
logger.error(new Error('Unknown playlist 123'));
The logger generator accepts the following options:
This boolean value specifies whether we should log pretty dev-friendly messages instead of JSON or not. By default, simple will be false.
Example:
const getLogger = require('@5app/logger');
// This logger will log dev-friendly messages
const logger = getLogger({
simple: true,
});
Metadata is an object containing service metadata like the release tag or the A/B testing experiment we are running. This object will be added to each log entry when using the JSON mode.
Example:
const getLogger = require('@5app/logger');
// This logger will add details about the current release and A/B experiment to every log line
const getLogger = require('@5app/logger');
const logger = getLogger({
metadata: {
release: '1.2.3',
experiment: 12345,
},
});
FAQs
Simple logger used in 5app microservices
The npm package @5app/logger receives a total of 554 weekly downloads. As such, @5app/logger popularity was classified as not popular.
We found that @5app/logger demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.