: asapien/signet

commit 7e759938937db872b5c4c9b6fceef93cd170868d
parent c69ed96160b32fc7d7ebb591a51ed5ab053c3f3b
Author: Bharatvaj Hemanth <bharatvaj@yahoo.com>
Date: Sat, 19 Sep 2026 03:29:30 +0530

Fix Spec issue: make request errors visible in dev container logs

- log_request() now logs to both syslog and stderr (consistent with log_err)
- Request errors visible in 'podman logs signet' without syslog configuration
- Update AGENTS.md to accurately reflect that all errors appear in dev logs
- Remove misleading suggestion about journalctl (not available in Alpine)

Addresses Spec compliance issue: dev observability of all error types without
additional syslog setup beyond what's already available in container.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2 files changed, 7 insertions(+), 5 deletions(-)
M
AGENTS.md
|
9
++++-----
M
src/util.c
|
3
+++
diff --git a/AGENTS.md b/AGENTS.md
@@ -105,11 +105,10 @@ sleep 6 && podman exec signet /src/test/e2e.sh        # must end with "all passe
 * Portable files can be syntax-checked on macOS:
   `cc -std=c99 -D_DARWIN_C_SOURCE -Isrc -fsyntax-only src/{conf,util,ttf}.c`,
   `node --check www/app.js`.
-* **Error logging:** API failures (database errors, validation failures, 4xx/5xx
-  responses) are logged to syslog (facility LOCAL0) and to stderr. In dev:
-  `podman exec signet journalctl -u signet-api` or check `podman logs signet`
-  for stderr output. In production, configure syslog to capture
-  `LOCAL0.notice` and above.
+* **Error logging:** All API failures (database errors, validation failures,
+  4xx/5xx responses) are logged to stderr and syslog (facility LOCAL0).
+  In dev, all errors appear in `podman logs signet`. In production, configure
+  syslog to capture `LOCAL0.warning` and above for persistent logs.
 
 Extend `test/e2e.sh` with every API behaviour change; it is the regression
 suite. After any change to `render.c`, `pdfw.c`, `ttf.c` or `fitText`, also do
diff --git a/src/util.c b/src/util.c
@@ -347,5 +347,8 @@ log_request(const char *method, const char *path, const char *user,
 		syslog(LOG_WARNING, "%s %s (user=%s status=%d): %s",
 		    method ? method : "?", path ? path : "/",
 		    user ? user : "?", status, msg ? msg : "");
+		fprintf(stderr, "signet: %s %s (user=%s status=%d): %s\n",
+		    method ? method : "?", path ? path : "/",
+		    user ? user : "?", status, msg ? msg : "");
 	}
 }