© 2016-2019 Resurface Labs Inc.
Logging usage of Node.js cloud apps, with user privacy by design.
- Installing With npm
- Logging From Express Route
- Logging From Express Middleware
- Logging With API
- Protecting User Privacy
Requires Node.js 6.10.x or later. No other dependencies to conflict with your app.
Installing With npm
npm install resurfaceio-logger --save
Logging From Express Route
After installing the module, create a logger and call it from the routes of interest.
const express = ;const app = ;const resurfaceio = ;const logger =url: 'https://...'rules: 'include strict';app;
Logging From Express Middleware
After installing the module, add a
HttpLoggerForExpress instance to your app, after
any body parsers in use.
const express = ;const app = ;// add body parsersconst resurfaceio = ;resurfaceioHttpLoggerForExpress;// define routes
Logging With API
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.
Protecting User Privacy
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 (
but logging rules are easily customized to meet the needs of any application.