refactor: move logging config to CLI entrypoint and redact payloads (A5) - #90
Open
ergut wants to merge 8 commits into
Open
refactor: move logging config to CLI entrypoint and redact payloads (A5)#90ergut wants to merge 8 commits into
ergut wants to merge 8 commits into
Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
…LOGSEQ_LOG_FILE Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
…ogger at DEBUG Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This closes A5, the last remaining item from the architecture review.
What changed
mcp_logseq.serverno longer configures logging. The old import-time block forced the root logger to DEBUG and unconditionally wrote~/.cache/mcp-logseq/mcp_logseq.log. A subprocess test now guarantees the import leaves the root logger untouched._setup_logging()runs at the start ofmain()and covers both transports: level comes fromLOGSEQ_LOG_LEVEL(defaultINFO), logs go to stderr, and a log file is written only whenLOGSEQ_LOG_FILEis set. Bad config never crashes the server: an invalid level falls back to INFO with a warning, an unopenable file degrades to stderr only.call_toolbody moved into a module-level_dispatch_tool_call()coroutine, and logs now carry only the tool name, sorted argument keys, and the result item count. Page and block content no longer lands in plaintext logs, which matters given the ACL layer's intent.logger.infoinlogseq.pythat dumped full page property values now logs keys only, and atLOGSEQ_LOG_LEVEL=DEBUGthe MCP SDK logger stays capped at INFO so inbound JSON-RPC payloads are not written to the log file.~/.cache/mcp-logseq/mcp_logseq.logmust setLOGSEQ_LOG_FILE.Testing
Full suite: 643 tests passing (13 new in
tests/unit/test_logging.pycovering level parsing, file handler opt-in, import purity, and redaction).Design spec and implementation plan are included under
docs/superpowers/.