Skip to content

Commit 7e1aa9f

Browse files
author
michael
committed
read BUILDKITD_LOG_FORMAT env
1 parent e4d7acb commit 7e1aa9f

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

cmd/buildctl/main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ func main() {
116116
debugEnabled = context.GlobalBool("debug")
117117
// Use Format flag to control log formatter
118118
logFormat := context.GlobalString("log-format")
119+
if logFormat == "" {
120+
logFormat = os.Getenv("BUILDKITD_LOG_FORMAT")
121+
}
119122
switch logFormat {
120123
case "json":
121124
logrus.SetFormatter(&logrus.JSONFormatter{})

cmd/buildkitd/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ func main() {
183183
Name: "log-format",
184184
Usage: "log formatter: json or text",
185185
Value: "text",
186+
EnvVar: "BUILDKITD_LOG_FORMAT",
186187
},
187188
cli.StringFlag{
188189
Name: "group",

0 commit comments

Comments
 (0)