express-influxdb-logger
Express logging middleware for InfluxDB syslog
Last updated a year ago by peakwinter .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install express-influxdb-logger 
SYNC missed versions from official npm registry.

express-influxdb-logger

express-influxdb-logger is an Express middleware that can be used to log info on all HTTP requests to an InfluxDB instance.

Getting Started

const express = require('express');
const createInfluxDBLogger = require('express-influxdb-logger');

const app = express();
app.use(createInfluxDBLogger({
  host: 'my-influxdb-server.host',
  port: 8086,
  database: 'database_name',
  username: 'influxdb_user',
  password: 'influxdb_password,
}));

// Then declare your route handlers below.

Configuration

The following options are accepted when creating an instance of the InfluxDB logger:

  • host: hostname of your InfluxDB server (required)
  • port: port on which the InfluxDB's HTTP server listens on (required)
  • database: name of the database to log to (required)
  • protocol: either 'http' or 'https' (required, default: https)
  • username: username to authenticate with if the server requires
  • password: password to authenticate with if the server requires
  • flushAfter: send log lines to the database in batches of this number (default: 5)
  • flushInterval: send log lines to the database after this number of milliseconds max (default: 10000)

Note the flushAfter and flushInterval config values work together. By default, a batch will be sent to the server every time it has least 5 log entries in it, OR after 10 seconds of staleness at the longest.

Credits

A TypeScript fork and extension of influx-express.

Current Tags

  • 1.1.1                                ...           latest (a year ago)

11 Versions

  • 1.1.1                                ...           a year ago
  • 1.1.0                                ...           a year ago
  • 1.0.8                                ...           a year ago
  • 1.0.7                                ...           a year ago
  • 1.0.6                                ...           a year ago
  • 1.0.5                                ...           a year ago
  • 1.0.4                                ...           a year ago
  • 1.0.3                                ...           a year ago
  • 1.0.2                                ...           a year ago
  • 1.0.1                                ...           a year ago
  • 1.0.0                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (17)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |