Skip to content

Commit 0181b45

Browse files
authored
Add json logging configuration to main container
1 parent 375aaf5 commit 0181b45

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

internal/orchestrator/provision.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ type dependsOnCondition struct {
3434
Condition string `yaml:"condition"`
3535
}
3636

37+
type logging struct {
38+
Driver string `yaml:"driver"`
39+
Options map[string]string `yaml:"options,omitempty"`
40+
}
41+
3742
type service struct {
3843
Image string `yaml:"image"`
3944
DependsOn map[string]dependsOnCondition `yaml:"depends_on,omitempty"`
@@ -46,6 +51,7 @@ type service struct {
4651
ExtraHosts []string `yaml:"extra_hosts,omitempty"`
4752
Labels map[string]string `yaml:"labels,omitempty"`
4853
Environment map[string]string `yaml:"environment,omitempty"`
54+
Logging *logging `yaml:"logging,omitempty"`
4955
}
5056

5157
type Provision struct {
@@ -330,6 +336,13 @@ func generateMainComposeFile(
330336
DockerAppPathLabel: app.FullPath.String(),
331337
},
332338
Environment: envs,
339+
Logging: &logging{
340+
Driver: "json-file",
341+
Options: map[string]string{
342+
"max-size": "5m",
343+
"max-file": "2",
344+
},
345+
},
333346
},
334347
}
335348

0 commit comments

Comments
 (0)