logrus: add deployment channel as field to the logs

This commit is contained in:
Florian Schüller 2024-08-01 18:04:06 +02:00 committed by Florian Schüller
parent 2da3a73308
commit 9006836afc
5 changed files with 80 additions and 11 deletions

View file

@ -110,6 +110,10 @@ func main() {
logrus.Warn("GLITCHTIP_DSN not configured, skipping initializing Sentry/Glitchtip")
}
if config.DeploymentChannel != "" {
logrus.AddHook(&common.EnvironmentHook{Channel: config.DeploymentChannel})
}
stateDir, ok := os.LookupEnv("STATE_DIRECTORY")
if !ok {
logrus.Fatal("STATE_DIRECTORY is not set. Is the service file missing StateDirectory=?")