httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Covener <>
Subject Re: [users@httpd] Make logging decision using two environment variables
Date Mon, 13 Oct 2014 18:29:48 GMT
On Mon, Oct 13, 2014 at 2:11 PM, Truesdell Douglas A <> wrote:

>  I am trying to add replace the address field in a log when there is an
> X-Forwarded-For header following the notes in
> 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?

​What sets your existing environment variable?​  If you currently use
SetEnv, you could move to SetEnvIf and have it set earlier. This would
allow you to use an expression in <if> that puts both variables in a string
and compares the concatenated value.

Eric Covener

View raw message