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.
express-bunyan-logger
Advanced tools
A express logger middleware powered by bunyan.
npm install express-bunyan-logger
To use the logger:
app.use(require('express-bunyan-logger')());
To use the errorLogger:
app.use(require('express-bunyan-logger').errorLogger());
And you can also pass bunyan logger options to the logger middleware:
app.use(require('express-bunyan-logger')({
name: 'logger',
streams: [{
level: 'info',
stream: process.stdout
}]
}));
Change default format:
app.use(require('express-bunyan-logger')({
format: ":remote-address - :user-agent[major] custom logger"
});
Format string, please go the source code to the metadata. ":name" will print out meta.name; ":name[key]" will print out the property 'key' of meta.name.
Or you can pass a function to options.format. This function accept a object as argument and return string.
Whether to parse user-agent in logger, default is =true=.
Function that translate statusCode into log level.
function(status, err /* only will work in error logger */) {
// return string of level
return "info";
}
Array of string, Those fields will be excluded from meta object which passed to bunyan
Write log line on request instead of response (for response times)
(The BSD License)
Copyright (c) 2013, Villa.Gao <jky239@gmail.com>;
FAQs
a bunyan logger middleware for express
The npm package express-bunyan-logger receives a total of 9,479 weekly downloads. As such, express-bunyan-logger popularity was classified as popular.
We found that express-bunyan-logger demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 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
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.