Registry / observability / connect-logger

connect-logger

JSON →
library0.0.1jsnpmunverified

connect-logger is a minimalistic Connect/Express middleware designed for logging incoming HTTP requests. Released in 2013, its latest and only version is `0.0.1`. The package primarily offers basic request logging with customizable format strings for date, status, method, URL, route, and response time. It allows for moment.js-style date formatting, though `moment` itself is not a direct dependency but rather an implied style guide. Due to its age and lack of updates, it is not compatible with modern Node.js versions, contemporary Express APIs, or ES Modules. Its lack of maintenance makes it unsuitable for production use in current environments, as it predates many standard logging practices and security considerations now common in web development.

npm install connect-logger
INSTALL
IMPORT
SIG · CONNECT-LOGGER
C
connect-logger
observabilityjavascriptv0.0.1
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

connectLogger
✓ const connectLogger = require('connect-logger');
This package is exclusively CommonJS due to its age (2013) and does not support ES Modules.

This example demonstrates how to integrate connect-logger into an Express application, showing both default and custom logging options.

const express = require('express'); const connectLogger = require('connect-logger'); const app = express(); // Basic usage with default options app.use(connectLogger()); // Example with custom format and date options app.use(connectLogger({ format: '%date %status %method %url - Response time: %time ms', date: 'YYYY-MM-DD HH:mm:ss' })); app.get('/', (req, res) => { res.send('Hello from connect-logger example!'); }); app.get('/test', (req, res) => { res.send('Another page!'); }); const port = 3000; app.listen(port, () => { console.log(`Server listening on http://localhost:${port}`); });
Debug
Known issues
breakingThe package `connect-logger` has not been updated since 2013 (version 0.0.1). It is highly incompatible with modern Node.js versions (e.g., Node.js 14+), Express.js versions (4.x+), and may cause runtime errors or unexpected behavior due to API changes in underlying frameworks.
fix
Migrate to a maintained logging middleware such as `morgan`, `pino-http`, or `winston-express`.
affects: 0.0.1
gotchaThis package is written exclusively in CommonJS. Attempting to use `import` statements (ES Modules) will result in a runtime error.
fix
Use CommonJS `require()` syntax. However, it's strongly recommended to use a modern, actively maintained logger that supports ES Modules if your project is ESM-based.
affects: 0.0.1
gotchaThere are significant security risks associated with using unmaintained packages. `connect-logger` has not received any security patches or updates for over a decade, making it vulnerable to known and unknown exploits, and potentially exposing your application to supply chain attacks or data breaches.
fix
Immediately replace this package with a well-maintained and audited logging solution. Do not use it in production or any environment handling sensitive data.
affects: 0.0.1
deprecatedThe `moment.js` library, which is implicitly referenced for date formatting, is now in maintenance mode and no longer recommended for new projects. Its API is also not directly integrated but rather an example for the `date` option, meaning `connect-logger` does not handle date formatting directly through moment.
fix
If migrating, consider modern date libraries like `date-fns` or the built-in `Intl.DateTimeFormat`.
affects: 0.0.1
Errors
Common errors & fixes
TypeError: Cannot read properties of undefined (reading 'call')
This error often occurs when `connect-logger` attempts to use internal Express/Connect APIs that have changed significantly or no longer exist in newer versions of Express.
fix
The only fix is to replace `connect-logger` with a modern, maintained logging middleware like `morgan` or `pino-http`.
SyntaxError: Cannot use import statement outside a module
Attempting to use `import connectLogger from 'connect-logger'` in a CommonJS context or when the package itself only provides CommonJS exports.
fix
Use `const connectLogger = require('connect-logger');`. However, given the package's age, consider migrating to a modern logging solution.
Upgrade
Version history
0.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
18 hits · last 30 days
node
16
OpenAI (training)
1
Resources
connect-logger — npm install connect-logger · libregistry