Skip to content

Conversation

@dralley
Copy link
Contributor

@dralley dralley commented Jan 17, 2026

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


- logs:
Dumps all logs specific to the task, including DEBUG logs, regardless of whether DEBUG logging
is otherwise enabled
Copy link
Contributor Author

@dralley dralley Jan 17, 2026

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.

Copy link
Contributor Author

@dralley dralley Jan 18, 2026

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)
Copy link
Contributor Author

@dralley dralley Jan 17, 2026

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.

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

As a user, I can enable DEBUG logging level for individual tasks

1 participant