Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • S swh-core
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 11
    • Issues 11
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 4
    • Merge requests 4
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Platform
  • Development
  • swh-core
  • Issues
  • #4229
Closed
Open
Issue created May 11, 2022 by Antoine R. Dumont@ardumontMaintainer

Properly declare a centralized logging configuration and then reuse

We need to simplify and centralize once and for all our logging configuration so it becomes clearer and more maintainable. They grew organically around multiple different implementation or services (celery task, gunicorn, cli...).

@olasd proposed a clear plan for that [1]

  • lift the logic [2] into a common utility function (moved to swh.core.logging/logger)

  • Drop the celery task backend configuration logging in favor of a call to the new utility function ^, pulling its arguments from a couple of environment variables (and the celery command line if relevant). Ensure the envvars are consistent with the ones that the swh command line supports.

  • Replace the gunicorn logconfig.ini [4] and the associated setup [5] to use the same utility function, with consistent environment variables.

  • Coalesce all the ad-hoc logger.setLevel calls strewn across our codebase, as well as gunicorn's hardcoded logconfig.ini, into a (bunch of) common yaml logging setup file(s) defined in puppet and docker.

  • update all the entry points / puppet deployment manifests / ... to use that common config file and envvar

  • [1] Copy/pasted from the excellent plan swh-loader-core!365 (closed)

  • [2] https://forge.softwareheritage.org/source/swh-core/browse/master/swh/core/cli/__init__.py$137-156

  • [3] https://forge.softwareheritage.org/source/swh-scheduler/browse/master/swh/scheduler/celery_backend/config.py$82-138

  • [4] https://forge.softwareheritage.org/source/puppet-swh-gunicorn/browse/master/files/logconfig.ini

  • [5] https://forge.softwareheritage.org/source/puppet-swh-gunicorn/browse/master/templates/gunicorn-instance.cfg.erb$40-42


Migrated from T4229 (view on Phabricator)

Edited Jan 07, 2023 by Phabricator Migration user
Assignee
Assign to
Time tracking