Skip to content

Update logger in gitlab:elastic rake to log to file and stdout

Proposal

The gitlab:elastic:**** rake tasks currently log to stdout only. We could use a single logger that tees out logs to both a log file and also stdout.

Rails has a feature for that https://api.rubyonrails.org/classes/ActiveSupport/BroadcastLogger.html

It would be an additional data point gathered from self managed customers using GitLabSOS or KubeSOS to have the logs from the rake task runs in elasticsearch.log file too.

Background

The following discussion from !153855 (merged) should be addressed:

  • @terrichu started a discussion: (+2 comments)

    @johnmason would you mind taking the backend maintainer review? I tested the specs out locally and they passed so hopefully everything is good 🤞