      if (clcf->error_log) {
          return "is duplicate";
      }
- 
-     value = cf->args->elts;
- 
-+#if (NGX_ENABLE_SYSLOG)
-+    if (ngx_strncmp(value[1].data, "syslog", sizeof("syslog") - 1) == 0) {
+@@ -4665,7 +4676,36 @@
+ 
+     if (ngx_strcmp(value[1].data, "stderr") == 0) {
+         ngx_str_null(&name);
++#if (NGX_ENABLE_SYSLOG)
++    } else if (ngx_strncmp(value[1].data, "syslog", sizeof("syslog") - 1) == 0) {
 +        if (!cf->cycle->new_log.syslog_set) {
 +            ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
 +                    "You must set the syslog directive and enable it first.");

diff --git a/src/core/ngx_cycle.c b/src/core/ngx_cycle.c
index 7986707..9902ef7 100644
--- a/src/core/ngx_cycle.c
+++ b/src/core/ngx_cycle.c
@@ -84,6 +84,12 @@ ngx_init_cycle(ngx_cycle_t *old_cycle)
     cycle->pool = pool;
     cycle->log = log;
     cycle->new_log.log_level = NGX_LOG_ERR;

     } else {
         name = NULL;
         n = ngx_http_log_script_write(r, log->script, &name, buf, len);
@@ -859,6 +885,10 @@
     log->script = NULL;
     log->disk_full_time = 0;
     log->error_log_time = 0;
