[GH-ISSUE #3288] LOG_DISABLE_REQUEST_LOGGING does nothing — Fastify request logging is always off #1783

Closed
opened 2026-10-21 05:42:39 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @kolacheee on GitHub (Jul 5, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3288

Originally assigned to: @SpicyMarinara on GitHub.

What's wrong

The LOG_DISABLE_REQUEST_LOGGING environment variable has no effect. Fastify's per-request access logs (the ... GET /api/... request completed lines) are always off, no matter what you set the variable to.

The cause is a one-character bug in packages/server/src/app.ts. The Fastify factory is handed the logging helper function itself instead of the value it returns:

disableRequestLogging: isRequestLoggingDisabled,   // passes the function, not its result

Fastify expects a boolean here. A function is always "truthy", so Fastify reads it as true and turns request logging off permanently. It should be isRequestLoggingDisabled() — with the parentheses, so it actually runs and returns true/false.

Try it yourself

  1. In your .env, set LOG_LEVEL=info. (Request logs only print at info or lower — the default warn hides them regardless, which is why this is easy to miss.)
  2. Leave LOG_DISABLE_REQUEST_LOGGING unset, or set it to false.
  3. Start Marinara and open the app, or hit any /api/... route.
  4. Expected: the server console prints a line per request, e.g. ... GET /api/chats ... request completed.
  5. Actual: those lines never appear. Flipping LOG_DISABLE_REQUEST_LOGGING between true and false changes nothing either way.

Knock-on effect for the docs

Fastify reads this option only once, when the server boots, so the flag can't take effect on the fly — it needs a restart. The docs currently list LOG_DISABLE_REQUEST_LOGGING among the variables that hot-reload without a restart (docs/REMOTE_ACCESS.md, docs/CONFIGURATION.md), which is wrong; it belongs on the restart-required side.

Fix

Call the function (isRequestLoggingDisabled()), and move the variable to the restart-required lists in both docs and in RESTART_REQUIRED_KEYS (packages/server/src/config/env-watcher.ts). Fix is in PR #3287.

Related: #3260 — a docs audit that first noticed this while documenting the "blocked IP is logged" troubleshooting tip.

Originally created by @kolacheee on GitHub (Jul 5, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3288 Originally assigned to: @SpicyMarinara on GitHub. ## What's wrong The `LOG_DISABLE_REQUEST_LOGGING` environment variable has no effect. Fastify's per-request access logs (the `... GET /api/... request completed` lines) are **always** off, no matter what you set the variable to. The cause is a one-character bug in `packages/server/src/app.ts`. The Fastify factory is handed the logging helper *function itself* instead of the value it returns: ```ts disableRequestLogging: isRequestLoggingDisabled, // passes the function, not its result ``` Fastify expects a boolean here. A function is always "truthy", so Fastify reads it as `true` and turns request logging off permanently. It should be `isRequestLoggingDisabled()` — with the parentheses, so it actually runs and returns true/false. ## Try it yourself 1. In your `.env`, set `LOG_LEVEL=info`. (Request logs only print at `info` or lower — the default `warn` hides them regardless, which is why this is easy to miss.) 2. Leave `LOG_DISABLE_REQUEST_LOGGING` unset, or set it to `false`. 3. Start Marinara and open the app, or hit any `/api/...` route. 4. **Expected:** the server console prints a line per request, e.g. `... GET /api/chats ... request completed`. 5. **Actual:** those lines never appear. Flipping `LOG_DISABLE_REQUEST_LOGGING` between `true` and `false` changes nothing either way. ## Knock-on effect for the docs Fastify reads this option only once, when the server boots, so the flag can't take effect on the fly — it needs a restart. The docs currently list `LOG_DISABLE_REQUEST_LOGGING` among the variables that hot-reload without a restart (`docs/REMOTE_ACCESS.md`, `docs/CONFIGURATION.md`), which is wrong; it belongs on the restart-required side. ## Fix Call the function (`isRequestLoggingDisabled()`), and move the variable to the restart-required lists in both docs and in `RESTART_REQUIRED_KEYS` (`packages/server/src/config/env-watcher.ts`). Fix is in PR #3287. Related: #3260 — a docs audit that first noticed this while documenting the "blocked IP is logged" troubleshooting tip.
bsakaguchi 2026-10-21 05:42:39 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#1783
No description provided.