Skip to content

fix(logging): let debug: true reach stderr, not only the log file - #348

Open
bakiburakogun wants to merge 1 commit into
nextcloud:masterfrom
bakiburakogun:fix/debug-reaches-stderr
Open

fix(logging): let debug: true reach stderr, not only the log file#348
bakiburakogun wants to merge 1 commit into
nextcloud:masterfrom
bakiburakogun:fix/debug-reaches-stderr

Conversation

@bakiburakogun

Copy link
Copy Markdown

Fixes #347

Problem

logger_config.yaml pins the stderr handler at WARNING, so with debug: true the detail goes to persistent_storage/logs/ccb.log while docker logs stays nearly silent. logger_config.k8s.yaml already has stderr at DEBUG, so only the manual-install and Docker paths are affected.

Everything describing what indexing is doing is INFO or DEBUGDispatching N file chunk(s), Waiting for file chunk 1/8 future to complete, embed_sources finished for 4 source(s): 3 succeeded, 1 errored with its per-source error dict. None of it surfaces. What does surface is the occasional ERROR traceback with no context around it, so from outside the container a healthy-but-slow run and a stuck one look identical.

Change

When debug is on, lower the stderr handler along with the logger levels. Reading the app config a few lines earlier is what makes it possible to decide before dictConfig runs. The default stays WARNING, so nothing changes for anyone who has not asked for debug; the file handler is untouched.

Guarded with .get() so a config without a stderr handler — a custom one, say — still starts.

Testing

On a four-node deployment with debug: true: before the change docker logs showed 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 read ccb.log.

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>
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.

debug: true does not make the indexing logs visible in docker logs

1 participant