Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
resurfaceio-logger
Advanced tools
Easily log API requests and responses to your own system of record.
Requires Node.js 10.x or later. No other dependencies to conflict with your app.
npm install resurfaceio-logger --save
After installing the module, add a HttpLoggerForExpress
instance to your app, after
any body parsers in use.
const express = require('express');
const app = express();
// add body parsers
const resurfaceio = require('resurfaceio-logger');
resurfaceio.HttpLoggerForExpress.add(app, {
url: 'http://localhost:4001/message',
rules: 'include debug'
});
// define routes
After installing the module, add a HttpLoggerForKoa
instance to your app, after
any body parsers in use.
const Koa = require('koa');
const app = new Koa();
// add body parsers
const resurfaceio = require('resurfaceio-logger');
resurfaceio.HttpLoggerForKoa.add(app, {
url: 'http://localhost:4001/message',
rules: 'include debug'
});
After installing the module, add a HttpLoggerForExpress
instance before calling applyMiddleware
.
const app = express();
const resurfaceio = require('resurfaceio-logger');
resurfaceio.HttpLoggerForExpress.add(app, {
url: 'http://localhost:4001/message',
rules: 'include debug'
});
const server = new ApolloServer({ ... });
server.applyMiddleware({ app });
After installing the module, create a logger and call it from the routes of interest.
const express = require('express');
const app = express();
const resurfaceio = require('resurfaceio-logger');
const logger = new resurfaceio.HttpLogger({
url: 'http://localhost:4001/message',
rules: 'include debug'
});
app.get('/', function (request, response) {
response.render('pages/index', function (e, html) {
response.status(200).send(html);
resurfaceio.HttpMessage.send(logger, request, response, html);
});
});
Loggers can be directly integrated into your application using our API. This requires the most effort compared with the options described above, but also offers the greatest flexibility and control.
Loggers always have an active set of rules that control what data is logged
and how sensitive data is masked. All of the examples above apply a predefined set of rules (include debug
),
but logging rules are easily customized to meet the needs of any application.
© 2016-2021 Resurface Labs Inc.
FAQs
Library for usage logging
The npm package resurfaceio-logger receives a total of 15 weekly downloads. As such, resurfaceio-logger popularity was classified as not popular.
We found that resurfaceio-logger demonstrated a healthy version release cadence and project activity because the last version was released less than 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
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.