Apache LogFormat and removing a header

I have a script that creates the header:

X-User-ID: 1234

I would like to log the value, but ideally not send it back to the client.

The logging can be done with:

LogFormat "... %{X-User-ID}o ..." inc_ref

But this does not work when I add:

Header unset "X-User-ID"

Is there a way to unset the header, but still log the value?


Not a solution, but the same question over at Header unset seems not to work with apache 2.4.10 and php-fpm.

Even if you use Header [always] note ..., logging that noted value with %{VARNAME}n does not work if you use Header [always] unset ....

Might be a bug in Apache.