🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

winex

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

winex

Winston-based Express logging middleware.

0.0.6
latest
npm
Version published
Weekly downloads
15
400%
Maintainers
2
Weekly downloads
 
Created
Source

winex

Winston-based Express logging middleware. Extracts basic metadata from the request and logs out on request end (so the status code of an HTTP response is captured).

Install

The usual

npm install winex

Although Winex uses Winston, it does not actually provide winston - the caller must provide a configured Winston logger object. So you get to (and must) choose your own version of Winston to add as a project dependency.

Middleware

Winex provides a basic middleware hook that attaches a Winston logger to req.locals._log that can be used within any middleware or request handlers. Add the middleware like:

var express = require('express'),
  // Real winston logger.
  winston = require('winston'),
  winLogger = new winston.Logger(),
  // Winex wrapper.
  winex = require('winex'),
  Log = winex.factory(winLogger),
  app = express.createServer();

app.configure(function () {
  // Log all requests.
  app.use(Log.middleware);
});

Handlers

Winex also provides some express / general exception handlers that will be documented at some point in the future.

License

Winex is Copyright 2012 Curiosity Media, Inc. Released under the MIT License.

FAQs

Package last updated on 18 Apr 2014

Did you know?

Socket

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.

Install

Related posts