]> granicus.if.org Git - apache/commitdiff
Follow-up to r1525597:
authorJeff Trawick <trawick@apache.org>
Tue, 15 Oct 2013 14:09:29 +0000 (14:09 +0000)
committerJeff Trawick <trawick@apache.org>
Tue, 15 Oct 2013 14:09:29 +0000 (14:09 +0000)
Initialize error log providers in vhosts, solving crashes
when logging from those vhosts as well as allowing a different
provider (or provider configuration) for vhosts.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1532344 13f79535-47bb-0310-9956-ffa450edef68

server/log.c

index 0ac4695cffa80a4ed6808e683a9f1f32a989c7aa..ca5450a26ce332ad25c503d73d32a7e9dc36b45b 100644 (file)
@@ -458,6 +458,18 @@ int ap_open_logs(apr_pool_t *pconf, apr_pool_t *p /* plog */,
                 virt->error_log = q->error_log;
             }
         }
+        else if (virt->errorlog_provider) {
+            /* separately-configured vhost-specific provider */
+            if (open_error_log(virt, 0, p) != OK) {
+                return DONE;
+            }
+        }
+        else if (s_main->errorlog_provider) {
+            /* inherit provider from s_main */
+            virt->errorlog_provider = s_main->errorlog_provider;
+            virt->errorlog_provider_handle = s_main->errorlog_provider_handle;
+            virt->error_log = NULL;
+        }
         else {
             virt->error_log = s_main->error_log;
         }