esa-pcg-cli 0.1.22 → 0.1.23-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -44,6 +44,32 @@ npx pcg serve --dir . --port 3000
44
44
 
45
45
  `pcg serve` starts the same `fc/start.mjs` that EFC executes.
46
46
 
47
+ ## Temporary Gateway network debug log
48
+
49
+ The existing EFC Gateway timing logs are also appended as NDJSON to
50
+ `/tmp/pcg-gateway-network.ndjson` on the machine/container running the FC process.
51
+ Each line preserves the JSON payload sent to `/function-logs`, including its
52
+ request ID and the `log` string containing `total` and `gwN` records. Only the
53
+ local copy adds `debug.gwN` with the destination `request.host`, HTTP method,
54
+ headers passed to fetch, response status/headers, and failure name/message/code
55
+ (including the immediate cause). Authorization, Cookie, key/token/secret and
56
+ other credential header values are replaced with `[REDACTED]`. Request query
57
+ parameters and bodies are not captured. Remote log payloads remain unchanged.
58
+ Collection still requires `ESA_EFC_FUNCTION_LOG_KEY` and valid function
59
+ name/version metadata.
60
+
61
+ Override the file path with `PCG_DEBUG_NETWORK_LOG_PATH` (its parent directory
62
+ must exist). Writes are asynchronous and best effort, with at most 64 pending
63
+ copies; a local write failure does not fail requests or remote log delivery.
64
+ Details exceeding the 64 KiB local record budget are omitted and marked with
65
+ `debug.truncated: true`.
66
+ The file has no rotation and new files use mode `0600`.
67
+
68
+ To remove this temporary debug aspect, delete `src/runtime/debug-network-log.cjs`,
69
+ its marked import/hooks in `src/runtime/efc-observability.cjs`, and the marked
70
+ source-tree copy in `src/artifacts/efc-observability.ts`, then rebuild the CLI and
71
+ application artifacts.
72
+
47
73
  ## Next.js integration
48
74
 
49
75
  Next.js builds run through OpenNext with PCG's wrapper, converter,