That's what I did but I would like to know if there's a better solution, because I don't want to use my own module and I prefer to do this only by using the directives that come with Apache and it's modules.
I think the simplest solution would be to receive the response header,
set an environment variable from that, then unset the header. You could
then use the environment variable to log from.