How To Show The Client IP Address In The Access Log and error_log When Using A Load Balancer
Hi All,
Customer followed note 1355549.1 and added %h to last line.
# grep LogFormat httpd.conf
LogFormat "%{X-Forwarded-For}i %h %l %u %t \"%r\" %>s %b %T \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b" X-Forwarded-For
LogFormat "%{X-Forwarded-For}i %h %l %u %t \"%r\" %>s %b %T"
#
The log become slight different format, but client IP can be seen now.
- asiatweb13.ang.sing.seagate.com - - [07/Jan/2014:14:52:02 +0800] "GET /oprocmgr-service?cmd=Register&index=1&modName=JServ&grpName=OACoreGroup&port=22179 HTTP/1.1" 200 15 0
- asiatweb13.ang.sing.seagate.com - - [07/Jan/2014:14:52:02 +0800] "GET /oprocmgr-service?cmd=Register&index=0&modName=JServ&grpName=OACoreGroup&port=22180 HTTP/1.1" 200 15 0