{"id":17423,"library":"connect-logger","title":"Connect Logging Middleware","description":"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.","status":"abandoned","version":"0.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/geta6/connect-logger","tags":["javascript","console","color","level","log","logger"],"install":[{"cmd":"npm install connect-logger","lang":"bash","label":"npm"},{"cmd":"yarn add connect-logger","lang":"bash","label":"yarn"},{"cmd":"pnpm add connect-logger","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package is exclusively CommonJS due to its age (2013) and does not support ES Modules.","symbol":"connectLogger","correct":"const connectLogger = require('connect-logger');"}],"quickstart":{"code":"const express = require('express');\nconst connectLogger = require('connect-logger');\n\nconst app = express();\n\n// Basic usage with default options\napp.use(connectLogger());\n\n// Example with custom format and date options\napp.use(connectLogger({\n  format: '%date %status %method %url - Response time: %time ms',\n  date: 'YYYY-MM-DD HH:mm:ss'\n}));\n\napp.get('/', (req, res) => {\n  res.send('Hello from connect-logger example!');\n});\n\napp.get('/test', (req, res) => {\n  res.send('Another page!');\n});\n\nconst port = 3000;\napp.listen(port, () => {\n  console.log(`Server listening on http://localhost:${port}`);\n});","lang":"javascript","description":"This example demonstrates how to integrate connect-logger into an Express application, showing both default and custom logging options."},"warnings":[{"fix":"Migrate to a maintained logging middleware such as `morgan`, `pino-http`, or `winston-express`.","message":"The 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.","severity":"breaking","affected_versions":"0.0.1"},{"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.","message":"This package is written exclusively in CommonJS. Attempting to use `import` statements (ES Modules) will result in a runtime error.","severity":"gotcha","affected_versions":"0.0.1"},{"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.","message":"There 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.","severity":"gotcha","affected_versions":"0.0.1"},{"fix":"If migrating, consider modern date libraries like `date-fns` or the built-in `Intl.DateTimeFormat`.","message":"The `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.","severity":"deprecated","affected_versions":"0.0.1"}],"env_vars":null,"last_verified":"2026-04-22T00:00:00.000Z","next_check":"2026-07-21T00:00:00.000Z","problems":[{"fix":"The only fix is to replace `connect-logger` with a modern, maintained logging middleware like `morgan` or `pino-http`.","cause":"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.","error":"TypeError: Cannot read properties of undefined (reading 'call')"},{"fix":"Use `const connectLogger = require('connect-logger');`. However, given the package's age, consider migrating to a modern logging solution.","cause":"Attempting to use `import connectLogger from 'connect-logger'` in a CommonJS context or when the package itself only provides CommonJS exports.","error":"SyntaxError: Cannot use import statement outside a module"}],"ecosystem":"npm","meta_description":null}