I am trying to add replace the address field in a log when there is an X-Forwarded-For header following the notes in http://www.techstacks.com/howto/log-client-ip-and-xforwardedfor-ip-in-apache.html. This reference shows how to create and use the necessary condition on the CustomLog directive. But in my case the CustomLog directive has a pre-existing environment variable selecting for it. So I am now wanting to select the CustomLog based on two environment variables. The logic would say “Log using a given format if ${A} and ${B}”.
The syntax for CustomLog supports a single “env” directive only. In addition, it appears that SetEnv can create a variable based only on a single property. Finally, “If” directives cannot use declared environment variables (since the If is evaluated before a declared variable is evaluated). So there seems to be no way to construct a logging decision in the form “A and B” using these tools. Is there some way to do this?