fix(logging): let debug: true reach stderr, not only the log file - #348
Open
bakiburakogun wants to merge 1 commit into
Open
fix(logging): let debug: true reach stderr, not only the log file#348bakiburakogun wants to merge 1 commit into
bakiburakogun wants to merge 1 commit into
Conversation
The stderr handler is pinned at WARNING in logger_config.yaml, so with debug: true the detail is written to persistent_storage/logs/ccb.log but docker logs stays nearly silent. The k8s config already has stderr at DEBUG. Everything that describes what indexing is doing is INFO or DEBUG, so from outside the container a healthy-but-slow run and a stuck one look the same: the only thing that surfaces is the occasional ERROR traceback, without the context around it. Lower the stderr handler along with the logger levels when debug is on, so turning debug on makes the logs visible where a container deployment reads them. Reading the app config a few lines earlier is what makes that possible. Fixes nextcloud#347 Signed-off-by: Baki Burak Öğün <63836730+bakiburakogun@users.noreply.github.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.
Fixes #347
Problem
logger_config.yamlpins thestderrhandler atWARNING, so withdebug: truethe detail goes topersistent_storage/logs/ccb.logwhiledocker logsstays nearly silent.logger_config.k8s.yamlalready has stderr atDEBUG, so only the manual-install and Docker paths are affected.Everything describing what indexing is doing is
INFOorDEBUG—Dispatching N file chunk(s),Waiting for file chunk 1/8 future to complete,embed_sources finished for 4 source(s): 3 succeeded, 1 erroredwith its per-source error dict. None of it surfaces. What does surface is the occasionalERRORtraceback with no context around it, so from outside the container a healthy-but-slow run and a stuck one look identical.Change
When
debugis on, lower thestderrhandler along with the logger levels. Reading the app config a few lines earlier is what makes it possible to decide beforedictConfigruns. The default staysWARNING, so nothing changes for anyone who has not asked for debug; the file handler is untouched.Guarded with
.get()so a config without astderrhandler — a custom one, say — still starts.Testing
On a four-node deployment with
debug: true: before the changedocker logsshowed only startup lines and error tracebacks; after it, the batch dispatch and per-source results appear, which is what made diagnosing #345 possible without going into the container to readccb.log.