{"id":18792630,"url":"https://github.com/peakwinter/express-influxdb-logger","last_synced_at":"2025-10-05T04:16:04.056Z","repository":{"id":143878837,"uuid":"186276740","full_name":"peakwinter/express-influxdb-logger","owner":"peakwinter","description":"Express logging middleware for InfluxDB syslog","archived":false,"fork":false,"pushed_at":"2019-05-12T21:49:19.000Z","size":70,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-30T03:48:20.771Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/peakwinter.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-12T16:14:44.000Z","updated_at":"2019-05-12T21:50:04.000Z","dependencies_parsed_at":"2023-12-10T13:45:09.613Z","dependency_job_id":null,"html_url":"https://github.com/peakwinter/express-influxdb-logger","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peakwinter%2Fexpress-influxdb-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peakwinter%2Fexpress-influxdb-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peakwinter%2Fexpress-influxdb-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peakwinter%2Fexpress-influxdb-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peakwinter","download_url":"https://codeload.github.com/peakwinter/express-influxdb-logger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239718373,"owners_count":19685725,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T21:20:57.309Z","updated_at":"2025-10-05T04:15:59.020Z","avatar_url":"https://github.com/peakwinter.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# express-influxdb-logger\n\nexpress-influxdb-logger is an [Express middleware](https://expressjs.com/en/guide/using-middleware.html) that can be used to log info on all HTTP requests to an InfluxDB instance in syslog format.\n\n## Getting Started\n\n```js\nconst express = require('express');\nconst createInfluxDBLogger = require('express-influxdb-logger');\n\nconst app = express();\napp.use(createInfluxDBLogger({\n  host: 'my-influxdb-server.host',\n  port: 8086,\n  database: 'database_name',\n  username: 'influxdb_user',\n  password: 'influxdb_password,\n}));\n\n// Then declare your route handlers below.\n```\n\n## Configuration\n\nThe following options are accepted when creating an instance of the InfluxDB logger:\n\n* `host`: hostname of your InfluxDB server _(required)_\n* `port`: port on which the InfluxDB's HTTP server listens on _(required)_\n* `database`: name of the database to log to _(required)_\n* `protocol`: either 'http' or 'https' _(required, default: `https`)_\n* `username`: username to authenticate with if the server requires\n* `password`: password to authenticate with if the server requires\n* `flushAfter`: send log lines to the database in batches of this number _(default: 5)_\n* `flushInterval`: send log lines to the database after this number of milliseconds max _(default: 10000)_\n* `measurement`: custom InfluxDB measurement name to use _(default: `syslog`)_\n* `appname`: application name to be provided in the syslog lines _(default: `express`)_\n* `facility`: syslog facility name to use _(default: `local0`)_\n* `client`: an instance of an `Influx.InfluxDB` connection to use rather than create a new one\n* `requestOptions`: an object of options passed directly to `https.request` when logging\n\nNote 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.\n\n## Credits\n\nA TypeScript fork and extension of [influx-express](https://github.com/jackzampolin/influx-express).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeakwinter%2Fexpress-influxdb-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeakwinter%2Fexpress-influxdb-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeakwinter%2Fexpress-influxdb-logger/lists"}