-
Notifications
You must be signed in to change notification settings - Fork 136
Add task-specific log capturing to task diagnostics mechanism #7217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
|
||
| - logs: | ||
| Dumps all logs specific to the task, including DEBUG logs, regardless of whether DEBUG logging | ||
| is otherwise enabled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: should this be the default behavior, or should there be a separate modifier to unfilter the logs?
Are there any concerns around data leakage? System logs were not previously thought of as potentially exposable via the API.
I filed #7214 before thinking of this specific idea - the idea there was to unfilter the logs for that task specifically in the log handler. I'm not actually sure if that is possible or desirable though. Maybe that setting could control the log level collected here, but maybe that's unnecessarily configurable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After figuring out how to implement this (see the last commit marked WIP), I kinda do think that it should be at most opt-in (if we do it at all), because it requires you to change the log level of the root logger, otherwise debug logs get filtered out completely.
| '%(asctime)s - %(name)s - %(levelname)s - %(message)s', | ||
| datefmt='%Y-%m-%d %H:%M:%S' | ||
| ) | ||
| file_handler.setFormatter(formatter) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: this is not the same formatter as the standard Pulp one. Should we use the same formatter? Maybe not? Correlation ID is a bit extraneous when all logs relate to the same task, the pulp prefix is irrelevant, removing some of that stuff is maybe useful.
5d9ca0f to
21eb4d6
Compare
TASK_DIAGNOSTICS and X-Task-Diagnostics can now capture all logs for specific tasks, including DEBUG logs, regardless of whether DEBUG logs are otherwise enabled for the system logger. Because the logs are specific to the task, the logs are linear and not broken up by unrelated logs from other services/workers/tasks. Assisted By: Claude closes pulp#7215
Temporarily change the root logger's log level, but make sure that the console logger is still only logging at INFO level. closes pulp#7214
TASK_DIAGNOSTICS and X-Task-Diagnostics can now capture all logs for specific tasks, including DEBUG logs, regardless of whether DEBUG logs are otherwise enabled for the system logger. Because the logs are specific to the task, the logs are linear and not broken up by unrelated logs from other services/workers/tasks.
Assisted By: Claude
closes #7214