You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* chore(logging): trim default log volume — reclassify routine info→debug, add trace tier
Container logs were unusable for support because ~1,450 server-side
logger.info calls print at the production default level. Almost all of the
high-frequency ones — per-packet, per-request, per-message, and periodic
scheduler activity, plus the ~60-line environment dump on every boot — are
routine and belong at debug.
Changes:
- logger.ts: add a `trace` level below `debug` for true per-packet firehose;
document the tier semantics (info = sparse, support-relevant events only).
- environment.ts: accept `trace` for LOG_LEVEL; collapse the boot env dump to
a compact ~16-line info summary (details → debug).
- Reclassify server logger.info calls: non-migration info 1452 → 865
(~590 demoted to debug, 11 to trace). Hot paths collapsed:
meshtasticManager 258→18, meshcoreManager 61→19, server.ts 49→20.
- Redact MeshCore message bodies from logs (contact/channel/room/DM/auto-ack
text → `(N chars)`); keep sender/channel metadata.
- Docs + docker-compose.yml + CHANGELOG updated; new trace-level test coverage.
An idle container is now near-silent at the default `info` level. Raise with
LOG_LEVEL=debug (or trace) — no NODE_ENV change needed.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015AFBA76hsjqhsXe1BdnYub
* address review: document trace unknown[] rationale + module-load level eval, cover trace in sanitization test
Addresses non-blocking notes from claude-review on #3994:
- logger.ts: comment why trace uses unknown[] (lint baseline) and why
currentLevel is import-time only (tests need vi.resetModules()).
- logger.test.ts: exercise logger.trace through the CWE-117 sanitization path.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015AFBA76hsjqhsXe1BdnYub
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
7
7
## [Unreleased]
8
8
9
9
### Changed
10
+
-**Container logs are far quieter at the default level.** Routine per-packet, per-request, and periodic-scheduler activity — plus the ~60-line environment dump printed on every boot — was logged at `info`, which is the production default, making Docker logs hard to use for support. That activity is now logged at `debug`; `info` is reserved for genuinely important, low-frequency events (startup/shutdown, source connect/disconnect, backups/restores/migrations, and deliberate actions taken), so an idle container is near-silent. A new `trace` level captures the full per-packet firehose. Raise verbosity for troubleshooting with `LOG_LEVEL=debug` (or `trace`) — no `NODE_ENV` change needed. As a side benefit, MeshCore message **bodies** are no longer written to logs (only sender/channel metadata and a length).
10
11
-**BREAKING (deployments behind a reverse proxy): `TRUST_PROXY` now defaults to `false`.** Previously, production builds trusted the first proxy hop when `TRUST_PROXY` was unset, which let a direct-connected client spoof `X-Forwarded-For` to bypass the auth brute-force limiter and poison audit attribution. Proxied deployments must now set `TRUST_PROXY` explicitly (`TRUST_PROXY=1` for a single proxy). Direct (non-proxied) deployments need no change.
Copy file name to clipboardExpand all lines: docs/configuration/index.md
+11-6Lines changed: 11 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -190,7 +190,7 @@ See the [Push Notifications guide](/features/notifications) for setup instructio
190
190
191
191
| Variable | Description | Default |
192
192
|----------|-------------|---------|
193
-
| `LOG_LEVEL` | Log verbosity: `debug`, `info`, `warn`, `error` | `debug` in development, `info` in production |
193
+
| `LOG_LEVEL` | Log verbosity: `trace`, `debug`, `info`, `warn`, `error` | `debug` in development, `info` in production |
194
194
195
195
**Note**: `LOG_LEVEL` controls log output independently of `NODE_ENV`. This lets you enable debug logging in production Docker deployments without changing rate limits, cookie warnings, or other `NODE_ENV`-dependent behavior.
196
196
@@ -320,12 +320,14 @@ MeshMonitor logs to stdout/stderr by default. Log output uses level prefixes: `[
320
320
321
321
### Log Levels
322
322
323
-
Control verbosity with the `LOG_LEVEL` environment variable:
323
+
Control verbosity with the `LOG_LEVEL` environment variable. Levels are
324
+
cumulative — each includes everything above it in this table:
324
325
325
326
| Level | What is logged |
326
327
|-------|---------------|
327
-
| `debug` | Everything — verbose diagnostics, state changes, data inspection |
328
-
| `info` | Informational messages, warnings, and errors |
328
+
| `trace` | Firehose — per-packet / per-loop diagnostics. Only enable for a short capture window; far too noisy for steady use. |
329
+
| `debug` | Verbose but bounded — routine per-event activity, periodic scheduler cycles, connection handshake steps, state inspection. |
330
+
| `info` | **Default in production.** Important, low-frequency events: startup/shutdown, source connect/disconnect, backups/restores/migrations, and deliberate actions taken. An idle container is near-silent at this level. |
329
331
| `warn` | Warnings and errors only |
330
332
| `error` | Errors only |
331
333
@@ -334,11 +336,14 @@ If `LOG_LEVEL` is not set, the default depends on `NODE_ENV`:
334
336
- `production`→ `info`
335
337
336
338
::: tip Troubleshooting in Production
337
-
Set `LOG_LEVEL=debug` to get verbose logging without changing `NODE_ENV`. This avoids side effects like altered rate limits or cookie warnings:
339
+
The default `info` level is deliberately quiet — routine per-packet, per-request,
340
+
and periodic-scheduler activity is logged at `debug`. To investigate an issue,
341
+
raise the level without changing `NODE_ENV` (this avoids side effects like
342
+
altered rate limits or cookie warnings):
338
343
```yaml
339
344
environment:
340
345
- NODE_ENV=production
341
-
- LOG_LEVEL=debug
346
+
- LOG_LEVEL=debug # or `trace` for the full per-packet firehose
0 commit comments