@@ -63,8 +63,8 @@ func validateRequirements(dataplaneBin, haproxyBin string) error {
63
63
}
64
64
65
65
// HAproxy doesn't exit immediately when you pass incorrect log address, so we try to do it on our own to fail fast
66
- func validateLogAddress (logAddress string ) error {
67
- // possible values taken from https://cbonte.github.io/haproxy-dconv/2.0/configuration.html#4.2-log
66
+ func validateHaproxyLogAddress (logAddress string ) error {
67
+ // allowed values taken from https://cbonte.github.io/haproxy-dconv/2.0/configuration.html#4.2-log
68
68
fi , err := os .Stat (logAddress )
69
69
if err != nil {
70
70
match , err := regexp .Match (`(fd@<[0-9]+>|stdout|stderr)` , []byte (logAddress ))
@@ -84,15 +84,15 @@ func validateLogAddress(logAddress string) error {
84
84
85
85
func main () {
86
86
versionFlag := flag .Bool ("version" , false , "Show version and exit" )
87
- logLevel := flag .String ("log-level" , "INFO" , "Log level" )
88
- logRequests := flag .Bool ("log-requests" , false , "Enable logging requests by Haproxy" )
89
- logAddress := flag .String ("log-address" , "" , "Syslog address for Haproxy logs (default: log to stderr with this app)" )
90
87
consulAddr := flag .String ("http-addr" , "127.0.0.1:8500" , "Consul agent address" )
91
88
service := flag .String ("sidecar-for" , "" , "The consul service id to proxy" )
92
89
serviceTag := flag .String ("sidecar-for-tag" , "" , "The consul service id to proxy" )
93
90
haproxyBin := flag .String ("haproxy" , haproxy_cmd .DefaultHAProxyBin , "Haproxy binary path" )
94
91
dataplaneBin := flag .String ("dataplane" , haproxy_cmd .DefaultDataplaneBin , "Dataplane binary path" )
95
92
haproxyCfgBasePath := flag .String ("haproxy-cfg-base-path" , "/tmp" , "Haproxy binary path" )
93
+ haproxyLogRequests := flag .Bool ("haproxy-log-requests" , false , "Enable logging requests by Haproxy" )
94
+ haproxyLogAddress := flag .String ("haproxy-log-address" , "" , "Syslog address for Haproxy logs (default: log to stderr with this app)" )
95
+ logLevel := flag .String ("log-level" , "INFO" , "Log level" )
96
96
statsListenAddr := flag .String ("stats-addr" , "" , "Listen addr for stats server" )
97
97
statsServiceRegister := flag .Bool ("stats-service-register" , false , "Register a consul service for connect stats" )
98
98
enableIntentions := flag .Bool ("enable-intentions" , false , "Enable Connect intentions" )
@@ -114,8 +114,8 @@ func main() {
114
114
}
115
115
log .SetLevel (ll )
116
116
117
- if * logAddress != "" {
118
- if err := validateLogAddress ( * logAddress ); err != nil {
117
+ if * haproxyLogAddress != "" {
118
+ if err := validateHaproxyLogAddress ( * haproxyLogAddress ); err != nil {
119
119
log .Fatal (err )
120
120
}
121
121
}
@@ -175,8 +175,8 @@ func main() {
175
175
EnableIntentions : * enableIntentions ,
176
176
StatsListenAddr : * statsListenAddr ,
177
177
StatsRegisterService : * statsServiceRegister ,
178
- LogRequests : * logRequests ,
179
- LogAddress : * logAddress ,
178
+ HAProxyLogRequests : * haproxyLogRequests ,
179
+ HAProxyLogAddress : * haproxyLogAddress ,
180
180
})
181
181
sd .Add (1 )
182
182
go func () {
0 commit comments