Bug #35906
closed[katello] Allow pulp_rest debugs for pulp3
Description
Description of problem:
With pulp2, Satellite/katello allowed to enable cp_rest and pulp_rest logging to see individual API requests to / resonses from [pulp|candlepin] - see https://access.redhat.com/solutions/3001661 . It is/was a nice feature allowing to 1) understand how katello manipulates with pulp/candlepin objects, 2) simplify a reproducer purely to pulp/candlepin.
Since pulp2to3 migration, this does not further work for pulp. The reason is, katello uses PulpcoreClient module that has class Configuration and :debugging, but no way to enable it.
I think the basic fix one-liner:
should be:
config.debugging = ::Foreman::Logging.logger('katello/pulp_rest').debug?
which enables debugs like:
2023-01-02T22:40:59 [D|kat|6ce9a60c] Calling API: DistributionsRpmApi.partial_update ...
2023-01-02T22:40:59 [D|kat|6ce9a60c] HTTP request body param BEGIN
6ce9a60c | {"content_guard":null,"base_path":"RedHat/Library/custom/zoo_product/ZOO_repo","publication":"/pulp/api/v3/publications/rpm/rpm/2e85692d-4690-4ea1-9092-7927187bf874/"}
6ce9a60c | END
6ce9a60c |
2023-01-02T22:40:59 [D|kat|6ce9a60c] HTTP response body BEGIN
6ce9a60c | {"task":"/pulp/api/v3/tasks/2656ab82-e498-4bdb-9424-08ff56776861/"}
6ce9a60c | END
6ce9a60c |
(note the debugs lack method and URL of the request, which will be a scope of another issue)
BUT that one-liner fix is not ideal: whenever foreman/katello enables logging debugs, it automatically evaluates
::Foreman::Logging.logger('katello/pulp_rest').debug?
to true. While I would expect the default logging level of pulp_rest (and also cp_rest) should be info
, something we should change via config. But I failed to override this default in either way.
Updated by The Foreman Bot about 2 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/Katello/katello/pull/10402 added
Updated by Samir Jha about 2 years ago
- Target version set to Katello 4.7.1
- Triaged changed from No to Yes
Updated by The Foreman Bot about 2 years ago
- Fixed in Releases Katello 4.8.0 added
Updated by Chris Roberts about 2 years ago
- Category set to Repositories
- Status changed from Ready For Testing to Closed
Updated by The Foreman Bot about 2 years ago
- Pull request https://github.com/Katello/katello/pull/10426 added
Updated by The Foreman Bot over 1 year ago
- Pull request https://github.com/Katello/katello/pull/10743 added