4

I have 2 servers with Apache 2.2 and LB (NetScaler),

I can see the client IP by using x-forwarded-for in access log but I do not see it in error log,

Is there any way to add x-forwarded-for in error log file?

2 Answers 2

5

In apache 2.2 you cannot change the error log format like ThatGremeGuy mentioned and his solution would be the best.

In 2.4 you can change it

http://httpd.apache.org/docs/2.4/logs.html#errorlog

2
  • Didn't realise there was a new ErrorLogFormat in 2.4, thanks. Apr 23, 2013 at 14:20
  • 1
    Your answer is the way to go in 2.2 which he said was the version.. I was just putting it out there in case others came and running 2.4
    – Mike
    Apr 23, 2013 at 15:08
2

You cannot change the format of the error log, but you can use mod_rpaf to log the client IP instead of the proxy (LB) IP.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .