Java Log Client IP using send-proxy header

Have anyone configured a java application to log client IP when the java application is running behind haproxy in tcp mode and the haproxy is configured to send the “send-proxy” header. A sample configuration is given below:

frontend myfrontend
mode tcp
retries 3
option redispatch
option clitcpka
timeout client 300s
timeout server 300s
option tcplog
default_backend mybackend

backend mybackend
mode tcp
server SERVER-1 check send-proxy

The java application is running on the backend server and I want to log the original client IP addresses. Right now when the IP address is logged through InetAddress.getLocalHost();

I am using HAproxy 2.4.4 which is the latest version right now.

Thank you very much.