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

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,35 @@ 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
+ Local debug logging is always enabled, including when
59
+ `ESA_EFC_FUNCTION_LOG_KEY` or function name/version metadata is missing.
60
+ Only remote delivery requires that key and valid function name/version metadata;
61
+ without them no remote log requests are enqueued.
62
+
63
+ Override the file path with `PCG_DEBUG_NETWORK_LOG_PATH` (its parent directory
64
+ must exist). Writes are asynchronous and best effort, with at most 64 pending
65
+ copies; a local write failure does not fail requests or remote log delivery.
66
+ Details exceeding the 64 KiB local record budget are omitted and marked with
67
+ `debug.truncated: true`.
68
+ The file has no rotation and new files use mode `0600`.
69
+
70
+ To remove this temporary debug aspect, delete `src/runtime/debug-network-log.cjs`,
71
+ its marked import/hooks in `src/runtime/efc-observability.cjs`, and the marked
72
+ source-tree copy in `src/artifacts/efc-observability.ts`, then rebuild the CLI and
73
+ application artifacts. Restore the marked collection condition to
74
+ `const collect = report` when removing the sink.
75
+
47
76
  ## Next.js integration
48
77
 
49
78
  Next.js builds run through OpenNext with PCG's wrapper, converter,