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?


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


  • Didn't realise there was a new ErrorLogFormat in 2.4, thanks. – ThatGraemeGuy Apr 23 '13 at 14:20
  • 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 '13 at 15:08

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.