osbuild-worker: add CHANNEL to worker logs
aka "the deployment channel" like "staging" or "production"
This commit is contained in:
parent
2519e55ccd
commit
8d24dcfbde
4 changed files with 22 additions and 0 deletions
|
|
@ -7,6 +7,7 @@ import (
|
|||
"errors"
|
||||
"flag"
|
||||
"fmt"
|
||||
slogger "github.com/osbuild/osbuild-composer/pkg/splunk_logger"
|
||||
"net/url"
|
||||
"os"
|
||||
"path"
|
||||
|
|
@ -193,6 +194,10 @@ func main() {
|
|||
logrus.Fatalf("Could not print config: %v", err)
|
||||
}
|
||||
|
||||
if config.DeploymentChannel != "" {
|
||||
logrus.AddHook(&slogger.EnvironmentHook{Channel: config.DeploymentChannel})
|
||||
}
|
||||
|
||||
cacheDirectory, ok := os.LookupEnv("CACHE_DIRECTORY")
|
||||
if !ok {
|
||||
logrus.Fatal("CACHE_DIRECTORY is not set. Is the service file missing CacheDirectory=?")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue