Skip to content

Feature: Set log level to DEBUG early#200

Merged
esnible merged 1 commit intokagenti:mainfrom
esnible:set-loglevel-early
Mar 25, 2026
Merged

Feature: Set log level to DEBUG early#200
esnible merged 1 commit intokagenti:mainfrom
esnible:set-loglevel-early

Conversation

@esnible
Copy link
Copy Markdown
Contributor

@esnible esnible commented Mar 24, 2026

Summary

The Weather Service example is hard-coded to log at DEBUG level. However, during initialization it logs at INFO level and these statements did not appear in the logs.

Related issue(s)

For #199

(Optional) Testing Instructions

Deploy this image from source using Kagenti and the repo and branch of this PR.
Then do oc -n team1 logs deployment/weather-service

Signed-off-by: Ed Snible <snible@us.ibm.com>
Copy link
Copy Markdown
Contributor

@rubambiza rubambiza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good — moving logging.basicConfig(level=logging.DEBUG) into __init__.py ensures DEBUG is active before setup_observability() and the agent module load. Clean and minimal change.

Minor (non-blocking): logging.basicConfig() is a no-op if the root logger already has handlers configured. Since this now runs first in the package, that's fine today, but worth keeping in mind if initialization order changes in the future.

@esnible esnible merged commit 1f976ec into kagenti:main Mar 25, 2026
9 checks passed
@esnible esnible deleted the set-loglevel-early branch March 25, 2026 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants