Commit Graph
6 Commits
Author SHA1 Message Date
nexgen_mirrors 45515b7f3c ix(logger): prevent log propagation to parent loggers\n\nDisable log propagation to avoid interference with parent loggers like Celery's. 2025-09-03 11:10:49 +09:30
coryHawkvelt 37aa2f2ded Updated logger.py to provide meaningful request IDs outside of Flask.
What changed:

Added a context-based ID source using Python ContextVar, used when explicitly set.
Preserved Flask behavior (reads g.request_id when a request context exists).
Added Celery awareness: when running in a Celery worker/task, it uses the current task’s id (or correlation_id) automatically.
Final fallback now includes process/thread info instead of “no-context”.
Resolution of the reported issue:

Your Celery worker logs will now include RequestID set to the Celery task id (or correlation_id). If not in a Celery task and not in Flask, the logger will emit a structured fallback like pid:1234|thr:MainThread rather than no-context.
For non-Flask, non-Celery jobs:

At the beginning of your job or script, set a correlation/request ID via the logger module’s context setter and clear it when done. This ensures all logs in that execution path include your chosen ID.
No changes required to your existing Flask code paths, and the formatter/handlers remain intact, so log output format is unchanged aside from improved request ID values
2025-08-25 10:37:03 +09:30
coryHawkvelt 4a9db0fd9f Added request ID to loggging 2025-04-06 01:46:41 +10:30
Your Name b6a32983dd deleted agents, merged with hosts 2025-02-09 19:58:48 +00:00
Your Name af4704e7e0 Agent enrollment workign 2025-02-09 17:21:32 +00:00
Your Name 680fa816de flying 2025-02-08 02:38:14 +00:00