Skip to content

Use GITLAB_LOG_LEVEL for Geo logs

Michael Kozono requested to merge mk/geo-customize-log-level into master

What does this MR do and why?

The Geo log level is tied to Rails log level, which is set to info, and I think GitLab doesn't provide a way to modify it. GitLab does provide GITLAB_LOG_LEVEL https://docs.gitlab.com/ee/administration/logs/index.html#override-default-log-level.

This MR makes geo.log output abide by GITLAB_LOG_LEVEL.

Related to &6034

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Configure Geo if you haven't already
  2. Add a env.runit file to the root directory of both GDK directories
  3. Add a line export GITLAB_LOG_LEVEL=warn to both env.runit files
  4. gdk restart both GDKs
  5. Observe logs with and without the environment variable set

You should see that if you set it to e.g. warn, then the services no longer output debug and info level logs.

I checked that for example error level is still output by manually modifying the checksum of a project repository in the project_states table in the primary site and then reverifying the project on the secondary site. It did output the error level log message as expected.

Edited by Michael Kozono

Merge request reports