fix(logging): let debug: true reach stderr, not only the log file - #348
fix(logging): let debug: true reach stderr, not only the log file#348bakiburakogun 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>
kyteinsky
left a comment
There was a problem hiding this comment.
thanks, yeah I suppose we can do this.
although the changes should be done in, they should be changed to DEBUG:
context_chat_backend/logger_config.yaml
Line 32 in 040adab
|
Thanks. Before I move it I wanted to check what the change would mean, because I think it changes the behaviour rather than only relocating it.
Which of the two would you prefer?
The |
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.