如何在 Apache 错误日志文件中添加 x-forwarded-for?

use*_*834 4 apache-2.2

我有 2 台带有 Apache 2.2 和 LB(NetScaler)的服务器,

我可以通过在访问日志中使用 x-forwarded-for 来查看客户端 IP,但我在错误日志中没有看到它,

有没有办法在错误日志文件中添加 x-forwarded-for ?

Mik*_*ike 5

在 apache 2.2 中,您不能像 ThatGremeGuy 提到的那样更改错误日志格式,他的解决方案将是最好的。

在 2.4 你可以改变它

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