Registry / http-networking / log-that-http

log-that-http

JSON →
library1.0.1jsnpmunverified

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.

npm install log-that-http
INSTALL
IMPORT
SIG · LOG-THAT-HTTP
L
log-that-http
http-networkingjavascriptv1.0.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
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 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

log-that-http
require('log-that-http')
import 'log-that-http'
Package is CommonJS-only; does not support ESM import.
LOG_THAT_HTTP_HEADERS
process.env.LOG_THAT_HTTP_HEADERS = 'true'
require('log-that-http').LOG_THAT_HTTP_HEADERS = true
Configuration is via environment variables, not exports.
LOG_THAT_HTTP_BODY
process.env.LOG_THAT_HTTP_BODY = 'true'
import { LOG_THAT_HTTP_BODY } from 'log-that-http'
Environment variable, not a named export.

Shows activating log-that-http with env vars and making a simple HTTP GET request. Logs request/response headers and body automatically.

// Enable via environment variables before requiring the package process.env.LOG_THAT_HTTP_HEADERS = 'true'; process.env.LOG_THAT_HTTP_BODY = 'true'; require('log-that-http'); const http = require('http'); http.get('http://example.com', (res) => { let data = ''; res.on('data', chunk => data += chunk); res.on('end', () => console.log('Done')); }).on('error', console.error);
Debug
Known issues
breakingKnown incompatibility with Node.js >=14 due to internal http module changes.
fix
Use only on Node.js 8–13 or test with your specific library.
affects: >=14.0.0
deprecatedPackage last updated in 2019; no longer maintained.
fix
Consider alternatives like 'pino-http' or 'morgan' for active logging solutions.
affects: all
gotchaMonkey-patches http/https globally; may interfere with other packages that also patch these modules.
fix
Load log-that-http first, before other http-modifying libraries.
affects: all
gotchaEnvironment variables must be set before the module is required; changing them later has no effect.
fix
Set LOG_THAT_HTTP_HEADERS and LOG_THAT_HTTP_BODY before require('log-that-http').
affects: all
Errors
Common errors & fixes
Cannot find module 'log-that-http'
Package not installed or wrong import style.
fix
Run 'npm install log-that-http' and use require('log-that-http').
LOG_THAT_HTTP_HEADERS is not defined
Trying to access environment variable as a module export.
fix
Use process.env.LOG_THAT_HTTP_HEADERS = 'true' before require.
TypeError: http.get is not a function
Package may be monkey-patching http module incorrectly on newer Node versions.
fix
Upgrade to a maintained logger or restrict Node version to <14.
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
16 hits · last 30 days
node
12
OpenAI (training)
2
Bingbot
1
Resources
log-that-http — npm install log-that-http · libregistry