Forum Moderators: phranque
I was looking for conditional logging to log only the requests that have status code = 200
You can't do that with the standard functionality of apache since no module which provides functionality to set set environmental variables acts in the ap_hook_log_transaction phase.
Either you write a tiny module which registers a hook in ap_hook_log_transaction as APR_HOOK_FIRST, evaluates r->status and sets an ENV (apr_table_set(r->subprocess_env, name, value)) accordingly;
-or - you move to piped logging and your external program evaluates the status code prior logging the information into a file.