@@ -63,8 +63,8 @@ func validateRequirements(dataplaneBin, haproxyBin string) error {
6363}
6464
6565// 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
6868 fi , err := os .Stat (logAddress )
6969 if err != nil {
7070 match , err := regexp .Match (`(fd@<[0-9]+>|stdout|stderr)` , []byte (logAddress ))
@@ -84,15 +84,15 @@ func validateLogAddress(logAddress string) error {
8484
8585func main () {
8686 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)" )
9087 consulAddr := flag .String ("http-addr" , "127.0.0.1:8500" , "Consul agent address" )
9188 service := flag .String ("sidecar-for" , "" , "The consul service id to proxy" )
9289 serviceTag := flag .String ("sidecar-for-tag" , "" , "The consul service id to proxy" )
9390 haproxyBin := flag .String ("haproxy" , haproxy_cmd .DefaultHAProxyBin , "Haproxy binary path" )
9491 dataplaneBin := flag .String ("dataplane" , haproxy_cmd .DefaultDataplaneBin , "Dataplane binary path" )
9592 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" )
9696 statsListenAddr := flag .String ("stats-addr" , "" , "Listen addr for stats server" )
9797 statsServiceRegister := flag .Bool ("stats-service-register" , false , "Register a consul service for connect stats" )
9898 enableIntentions := flag .Bool ("enable-intentions" , false , "Enable Connect intentions" )
@@ -114,8 +114,8 @@ func main() {
114114 }
115115 log .SetLevel (ll )
116116
117- if * logAddress != "" {
118- if err := validateLogAddress ( * logAddress ); err != nil {
117+ if * haproxyLogAddress != "" {
118+ if err := validateHaproxyLogAddress ( * haproxyLogAddress ); err != nil {
119119 log .Fatal (err )
120120 }
121121 }
@@ -175,8 +175,8 @@ func main() {
175175 EnableIntentions : * enableIntentions ,
176176 StatsListenAddr : * statsListenAddr ,
177177 StatsRegisterService : * statsServiceRegister ,
178- LogRequests : * logRequests ,
179- LogAddress : * logAddress ,
178+ HAProxyLogRequests : * haproxyLogRequests ,
179+ HAProxyLogAddress : * haproxyLogAddress ,
180180 })
181181 sd .Add (1 )
182182 go func () {
0 commit comments