{"id":18511,"library":"log-that-http","title":"log-that-http","description":"Monkey-patches Node.js built-in http/https modules to log outgoing requests and responses to console. v1.0.1 is the current stable release; last updated in 2019. No dependencies, supports Node >=8. Works transparently with axios, got, node-fetch, request, superagent, and native http/https. Controlled via environment variables (LOG_THAT_HTTP_HEADERS, LOG_THAT_HTTP_BODY). Not actively maintained, but functional for debugging. Contrasts with request-intercepting libraries like nock or mockttp by focusing on logging without mocking.","status":"maintenance","version":"1.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/aautio/log-that-http","tags":["javascript"],"install":[{"cmd":"npm install log-that-http","lang":"bash","label":"npm"},{"cmd":"yarn add log-that-http","lang":"bash","label":"yarn"},{"cmd":"pnpm add log-that-http","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Package is CommonJS-only; does not support ESM import.","wrong":"import 'log-that-http'","symbol":"log-that-http","correct":"require('log-that-http')"},{"note":"Configuration is via environment variables, not exports.","wrong":"require('log-that-http').LOG_THAT_HTTP_HEADERS = true","symbol":"LOG_THAT_HTTP_HEADERS","correct":"process.env.LOG_THAT_HTTP_HEADERS = 'true'"},{"note":"Environment variable, not a named export.","wrong":"import { LOG_THAT_HTTP_BODY } from 'log-that-http'","symbol":"LOG_THAT_HTTP_BODY","correct":"process.env.LOG_THAT_HTTP_BODY = 'true'"}],"quickstart":{"code":"// Enable via environment variables before requiring the package\nprocess.env.LOG_THAT_HTTP_HEADERS = 'true';\nprocess.env.LOG_THAT_HTTP_BODY = 'true';\n\nrequire('log-that-http');\n\nconst http = require('http');\nhttp.get('http://example.com', (res) => {\n  let data = '';\n  res.on('data', chunk => data += chunk);\n  res.on('end', () => console.log('Done'));\n}).on('error', console.error);","lang":"javascript","description":"Shows activating log-that-http with env vars and making a simple HTTP GET request. Logs request/response headers and body automatically."},"warnings":[{"fix":"Use only on Node.js 8–13 or test with your specific library.","message":"Known incompatibility with Node.js >=14 due to internal http module changes.","severity":"breaking","affected_versions":">=14.0.0"},{"fix":"Consider alternatives like 'pino-http' or 'morgan' for active logging solutions.","message":"Package last updated in 2019; no longer maintained.","severity":"deprecated","affected_versions":"all"},{"fix":"Load log-that-http first, before other http-modifying libraries.","message":"Monkey-patches http/https globally; may interfere with other packages that also patch these modules.","severity":"gotcha","affected_versions":"all"},{"fix":"Set LOG_THAT_HTTP_HEADERS and LOG_THAT_HTTP_BODY before require('log-that-http').","message":"Environment variables must be set before the module is required; changing them later has no effect.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install log-that-http' and use require('log-that-http').","cause":"Package not installed or wrong import style.","error":"Cannot find module 'log-that-http'"},{"fix":"Use process.env.LOG_THAT_HTTP_HEADERS = 'true' before require.","cause":"Trying to access environment variable as a module export.","error":"LOG_THAT_HTTP_HEADERS is not defined"},{"fix":"Upgrade to a maintained logger or restrict Node version to <14.","cause":"Package may be monkey-patching http module incorrectly on newer Node versions.","error":"TypeError: http.get is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}