Skip to content

Configure LogTape so Fedify federation logs surface - #182

Merged
malkoG merged 1 commit into
devfrom
feat/fedify-logtape-logging
Oct 9, 2026
Merged

malkoG merged 1 commit into
devfrom
feat/fedify-logtape-logging

Conversation

@malkoG

@malkoG malkoG commented Oct 9, 2026

Copy link
Copy Markdown
Member

Summary

Fedify routes all of its logging through LogTape, and LogTape discards every record until a sink is configured. Moim never configured one, so inbox/outbox traffic, HTTP Signature failures, and unhandled activity types were invisible. This wires a console sink controlled by FEDIFY_LOG_LEVEL (default info) and attaches an AsyncLocalStorage so Fedify's per-request log context is carried through.

Why

  • Debugging federation was blind
    • While investigating a Mastodon → Moim FeatureRequest that stayed "pending", there was no way to see whether the request arrived, failed signature verification, or was rejected; the root cause (Missing actor) only became visible after this change.
  • Fedify warns without context storage
    • Fedify calls withContext() per request; without contextLocalStorage LogTape logs Context-local storage is not configured twice per request and drops the context.
  • Keep page views quiet
    • Fedify logs a 404 warning under fedify.federation.http for every non-federation path it hands back to TanStack, i.e. every page view. That category is held to error unless the level is debug/trace, where seeing every request path is the point.

Commit History

  • Configure LogTape so Fedify federation logs surface : adds src/server/logging.ts, FEDIFY_LOG_LEVEL env + docs, imports the config first in server-entry.ts

Test Plan

  • tsc --noEmit and oxlint pass
  • With FEDIFY_LOG_LEVEL=debug, an inbox POST shows fedify.federation.inbox / fedify.sig.* lines and no logtape.meta warnings
  • At the default info level, page views produce no fedify.federation.http 404 warnings
  • Confirm log volume is acceptable on the production container at info

Assisted-By: Claude Code(claude-fable-5-1)

Fedify emits all of its logs through LogTape, which drops everything
when no sink is configured, so inbox/outbox traffic and signature
failures were invisible. Wire a console sink with FEDIFY_LOG_LEVEL
(default info), attach an AsyncLocalStorage so Fedify's per-request
context is carried, and silence the per-page-view 404 warnings from
fedify.federation.http outside debug/trace.

Co-authored-by: Claude Code <noreply@anthropic.com>
Assisted-By: Claude Code(claude-fable-5-1)
@coderabbitai

coderabbitai Bot commented Oct 9, 2026

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2de55cf7-76a1-4a0c-87bd-c0ccfd686678

📥 Commits

Reviewing files that changed from the base of the PR and between 3ee1316 and 91436b3.


⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml

📒 Files selected for processing (6)
  • .env.example
  • AGENTS.md
  • package.json
  • src/server-entry.ts
  • src/server/env.ts
  • src/server/logging.ts

 _______________________________
< The only circle I like is CI. >
 -------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR

🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR


  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@malkoG
malkoG merged commit 896cfa1 into dev Oct 9, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant