Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

express-bunyan-logger

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-bunyan-logger - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

30

index.js

@@ -14,8 +14,10 @@ var bunyan = require('bunyan'),

module.exports.errorLogger = function(opts) {
var logger, opts = opts || {
// default format
format: ":remote-address - :method :url HTTP/:http-version :status-code :content-length :referer :user-agent[family] :user-agent[major].:user-agent[minor] :user-agent[os]"
};
(typeof opts.format != 'function') && (opts.format = compile(opts.format));
var logger, opts = opts || {}, format;
// default format
format = opts.format || ":remote-address - :method :url HTTP/:http-version :status-code :content-length :referer :user-agent[family] :user-agent[major].:user-agent[minor] :user-agent[os]";
delete opts.format; // don't pass it to bunyan
(typeof format != 'function') && (format = compile(format));
return function(err, req, res, next) {

@@ -28,8 +30,8 @@ function logging() {

status = res.statusCode,
method = req.method,
url = req.url || '-',
referer = req.header('referer') || '-',
ua = useragent.parse(req.header('user-agent')),
httpVersion = req.httpVersionMajor+'.'+req.httpVersionMinor,
ip, logFn;
method = req.method,
url = req.url || '-',
referer = req.header('referer') || '-',
ua = useragent.parse(req.header('user-agent')),
httpVersion = req.httpVersionMajor+'.'+req.httpVersionMinor,
ip, logFn;

@@ -76,3 +78,3 @@

logFn.call(logger, meta, opts.format(meta));
logFn.call(logger, meta, format(meta));
}

@@ -95,4 +97,4 @@

return '"\n + ((meta["' + name + '"]) || "-") + "';
}) + '";'
}) + '";';
return new Function('meta', js);
};
}
{
"name": "express-bunyan-logger",
"version": "0.0.3",
"version": "0.0.4",
"description": "a bunyan logger middleware for express",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -9,3 +9,3 @@ var express = require('express'),

var app = express();
app.use(bunyanLogger());
app.use(bunyanLogger({}));

@@ -12,0 +12,0 @@ app.get('/', function(req, res) {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc