
Security News
Django Joins curl in Pushing Back on AI Slop Security Reports
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
express-elasticsearch-logger
Advanced tools
Log Express app requests to ElasticSearch.
Install using npm:
npm install express-elasticsearch-logger
Members
##logger.request
Document indexed with ElasticSearch. request
and response
properties
are included if they are whitelisted by config.whitelist
.
Properties
String
- defaults to "development"Error
- error object passed to next()
Number
- milliseconds between request and responseObject
String
Object
String
String
String
String
Object
Object
Number
Object
Number
- OS total memory in bytesNumber
- OS free memory in bytesArray.<Number>
- Array of 5, 10, and 15 min averagesObject
Number
- process memory in bytesString
- ISO time of requestType: Object
##logger.requestHandler(config, [client])
Returns Express middleware configured according to given options
.
Middleware must be mounted before all other middleware to ensure accurate capture of requests. The error handler must be mounted before other error handler middleware.
Params
Object
- elasticsearch configuration
String
- elasticsearch index (default: log_YEAR_MONTH)String
- elasticsearch request type (default: request)Object
Array.<String>
- request properties to logArray.<String>
- response properties to logArray.<String>
- list of request body properties to censorelasticsearch.Client
- elasticsearch clientReturns: elasticsearchLoggerMiddleware
- express middleware
Example
var express = require('express');
var logger = require('express-elasticsearch-logger');
var app = express();
app
.use(logger.requestHandler({
host: 'http://localhost:9200'
})
.get('/', function (req, res, next) {
res.sendStatus(204);
})
.use(logger.errorHandler);
##logger.errorHandler(err, req, res, next)
Error handler middleware exposes error to Response#end
This middleware is used in combination with requestHandler to capture request errors.
Params
Error
express.Request
express.Response
express.Request.next
Please submit all issues and pull requests to the alexmingoia/express-elasticsearch-logger repository!
List available tasks with gulp help
.
Run tests using npm test
or gulp test
.
If you have any problem or suggestion please open an issue here.
FAQs
Log Express app requests to ElasticSearch.
The npm package express-elasticsearch-logger receives a total of 68 weekly downloads. As such, express-elasticsearch-logger popularity was classified as not popular.
We found that express-elasticsearch-logger 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
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.