Change pulpcore logs location on Red Hat Private Automation Hub

Solution Verified - Updated -

Environment

  • Ansible Private Automation Hub.

Issue

  • pulpcore sends logs by default to /var/log/messages.
  • The /var/log/messages is flooded and hiding real OS issues, e.g. Basic OS services or also PCP pmie alerts of overall OS performance.

Resolution

1) Create file /etc/rsyslog.d/pulp.conf with the following content :

if $programname == 'pulpcore-api' then {
  *.* /var/log/pulp/pulpcore-api.log
  *.* stop
} else if $programname startswith 'pulpcore-worker' then {
  *.* /var/log/pulp/pulpcore-worker.log
  *.* stop
} else if $programname == 'gunicorn' then {
  *.* /var/log/pulp/pulp.log
  *.* stop
} else if $programname == 'pulpcore-content' then {
  *.* /var/log/pulp/pulpcore-content.log
  *.* stop
}

2) Create the logs directory:

# mkdir /var/log/pulp/

3) Restart rsyslog service:

# systemctl restart rsyslog

Root Cause

  • The /var/log/messages is flooded and hiding real OS issues, e.g. Basic OS services or also PCP pmie alerts of overall OS performance.

Diagnostic Steps

  • /var/log/message is full of pulp logs :
Mar 24 14:25:51  PAH gunicorn[150402]: pulp [-]:  - - [24/Mar/2023:13:25:51 +0000] "GET /static/galaxy_ng/css/App.cd75cc498868e8ad34e5.css HTTP/1.0" 200 0 "https://PAH-FQDN/ui/tasks" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36"
Mar 24 14:25:56  PAH gunicorn[150403]: pulp [-]:  - - [24/Mar/2023:13:25:56 +0000] "GET /static/galaxy_ng/js/682.1661352386064.7515e97e667f084a7fe1.js HTTP/1.0" 200 0 "https:// PAH-FQDN/ui/tasks" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36"
Mar 24 14:25:56  PAH gunicorn[150403]: pulp [-]:  - - [24/Mar/2023:13:25:56 +0000] "GET /static/galaxy_ng/fonts/logo_small.svg HTTP/1.0" 304 0 "https://PAH-FQDN/ui/tasks" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36"
Mar 24 14:13:03  PAH pulpcore-worker[150763]: pulp []: pulpcore.tasking.pulpcore_worker:INFO: Task completed d0f5992e-e0ec-4810-9730-b00d4b03aed2
Mar 24 14:13:03  PAH pulpcore-worker[150764]: pulp []: pulpcore.tasking.pulpcore_worker:INFO: Starting task e755cdb7-3f47-4057-afb4-9b8e5ea65623
Mar 24 14:14:33  PAH pulpcore-worker[150819]: pulp []: pulp_container.app.downloaders:INFO: Updating bearer token
Mar 24 14:14:34  PAH pulpcore-worker[150816]: pulp []: pulpcore.tasking.pulpcore_worker:INFO: Task completed 34c9dece-0986-453d-92df-089978e25a18
Mar 24 14:14:34  PAH pulpcore-worker[150822]: pulp []: pulpcore.tasking.pulpcore_worker:INFO: Starting task 098979da-8a01-486e-9548-85f131d53227

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments