{"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,"search_vec":"'2019':31 '8':36 'activ':63 'axio':40 'bodi':61 'built':10 'built-in':9 'consol':21 'contrast':69 'control':50 'current':25 'debug':68 'depend':33 'environ':52 'fetch':44 'focus':80 'function':66 'got':41 'header':57 'http':4,56,60 'http/https':12,49 'intercept':73 'javascript':85 'last':28 'librari':74 'like':75 'log':2,15,54,58,82 'log-that-http':1 'maintain':64 'mock':84 'mockttp':78 'modul':13 'monkey':6 'monkey-patch':5 'nativ':48 'nock':76 'node':35,43 'node-fetch':42 'node.js':8 'outgo':16 'patch':7 'releas':27 'request':17,45,72 'request-intercept':71 'respons':19 'stabl':26 'superag':46 'support':34 'transpar':38 'updat':29 'v1.0.1':22 'variabl':53 'via':51 'without':83 'work':37","created_at":"2026-04-25T07:38:41.735856+00:00","updated_at":"2026-04-25T07:38:41.735856+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/aautio/log-that-http","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/log-that-http","openapi_spec":null,"status_page":null,"smithery":null,"categories":["http-networking","observability"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-24","install_tag":null}}