简体   繁体   中英

aws ELB log missing backend_status_code & elb_status_code

When I activated the logging on my ELB instance, I noticed that both the ELB_status_code and backend_status_code were missing.

I have a setup where the ELB redirects everything to 2 ha-proxies. in the ha-proxy log the status code is visible.

The ELB is doing TCP:80 > TCP:80 using the proxy protocol.

Is there anything that i have to do specifically to enable the status code logging?

Those fields only apply to [HTTP listener] .

When ELB is running in TCP mode, it's not aware that the protocol running through it happens to be HTTP, so those status codes can't be logged.

If you really want to see them, you'll need the ELB in HTTP mode... but whether that's the right choice depends on why you are using TCP mode -- web sockets, for example, require TCP mode.

Note also that if you switch the ELB to HTTP mode, some of the Tq/Tw/Tc/Tr/Tt the timers in the HAProxy logs will show values that are initially confusing, because the ELB holds connections open to the back-end (which is HAProxy) for reuse in a way that differs somewhat from the way browsers tend to. Logging the %Ci and %Cp parameters in HAProxy will help make some sense of these by allowing you to correlate them.

http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/access-log-collection.html#access-log-entry-format

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM