diff -ru httpd-2.0.51/modules/loggers/mod_log_config.c httpd-2.0.51.new/modules/loggers/mod_log_config.c --- httpd-2.0.51/modules/loggers/mod_log_config.c 2004-06-01 17:30:16.000000000 +0200 +++ httpd-2.0.51.new/modules/loggers/mod_log_config.c 2004-09-20 16:29:40.000000000 +0200 @@ -321,10 +321,19 @@ static const char *log_remote_user(request_rec *r, char *a) { - char *rvalue = r->user; - - if (rvalue == NULL) { - rvalue = "-"; + char *rvalue; + const char *sent_pw; + + if (r->user == NULL) { + /* Try to get user from basic authentication data if available. + * Useful in reverse proxy scenarios where the real servers + * are using basic auth and we need user logging */ + if (ap_get_basic_auth_pw(r, &sent_pw) == OK) { + rvalue = r->user; + } + else { + rvalue = "-"; + } } else if (strlen(rvalue) == 0) { rvalue = "\"\"";