1 /* ====================================================================
2 * The Apache Software License, Version 1.1
4 * Copyright (c) 2000-2003 The Apache Software Foundation. All rights
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in
16 * the documentation and/or other materials provided with the
19 * 3. The end-user documentation included with the redistribution,
20 * if any, must include the following acknowledgment:
21 * "This product includes software developed by the
22 * Apache Software Foundation (http://www.apache.org/)."
23 * Alternately, this acknowledgment may appear in the software itself,
24 * if and wherever such third-party acknowledgments normally appear.
26 * 4. The names "Apache" and "Apache Software Foundation" must
27 * not be used to endorse or promote products derived from this
28 * software without prior written permission. For written
29 * permission, please contact apache@apache.org.
31 * 5. Products derived from this software may not be called "Apache",
32 * nor may "Apache" appear in their name, without prior written
33 * permission of the Apache Software Foundation.
35 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
36 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
37 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
38 * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
39 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
40 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
41 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
42 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
43 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
44 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
45 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
47 * ====================================================================
49 * This software consists of voluntary contributions made by many
50 * individuals on behalf of the Apache Software Foundation. For more
51 * information on the Apache Software Foundation, please see
52 * <http://www.apache.org/>.
54 * Portions of this software are based upon public domain software
55 * originally written at the National Center for Supercomputing Applications,
56 * University of Illinois, Urbana-Champaign.
60 * http_log.c: Dealing with the logs and errors
67 #include "apr_general.h" /* for signal stuff */
68 #include "apr_strings.h"
69 #include "apr_errno.h"
70 #include "apr_thread_proc.h"
72 #include "apr_signal.h"
74 #define APR_WANT_STDIO
75 #define APR_WANT_STRFUNC
87 #include "ap_config.h"
89 #include "http_config.h"
90 #include "http_core.h"
92 #include "http_main.h"
93 #include "util_time.h"
101 APR_HOOK_LINK(error_log)
104 int AP_DECLARE_DATA ap_default_loglevel = DEFAULT_LOGLEVEL;
108 static const TRANS facilities[] = {
111 {"authpriv",LOG_AUTHPRIV},
117 {"daemon", LOG_DAEMON},
135 {"syslog", LOG_SYSLOG},
144 {"local0", LOG_LOCAL0},
147 {"local1", LOG_LOCAL1},
150 {"local2", LOG_LOCAL2},
153 {"local3", LOG_LOCAL3},
156 {"local4", LOG_LOCAL4},
159 {"local5", LOG_LOCAL5},
162 {"local6", LOG_LOCAL6},
165 {"local7", LOG_LOCAL7},
171 static const TRANS priorities[] = {
172 {"emerg", APLOG_EMERG},
173 {"alert", APLOG_ALERT},
174 {"crit", APLOG_CRIT},
175 {"error", APLOG_ERR},
176 {"warn", APLOG_WARNING},
177 {"notice", APLOG_NOTICE},
178 {"info", APLOG_INFO},
179 {"debug", APLOG_DEBUG},
183 static apr_file_t *stderr_log = NULL;
185 AP_DECLARE(void) ap_open_stderr_log(apr_pool_t *p)
187 apr_file_open_stderr(&stderr_log, p);
190 AP_DECLARE(apr_status_t) ap_replace_stderr_log(apr_pool_t *p,
193 apr_file_t *stderr_file;
195 char *filename = ap_server_root_relative(p, fname);
197 ap_log_error(APLOG_MARK, APLOG_STARTUP|APLOG_CRIT,
198 APR_EBADPATH, NULL, "Invalid -E error log file %s",
202 if ((rc = apr_file_open(&stderr_file, filename,
203 APR_APPEND | APR_READ | APR_WRITE | APR_CREATE,
204 APR_OS_DEFAULT, p)) != APR_SUCCESS) {
205 ap_log_error(APLOG_MARK, APLOG_STARTUP, rc, NULL,
206 "%s: could not open error log file %s.",
207 ap_server_argv0, fname);
210 if ((rc = apr_file_open_stderr(&stderr_log, p)) == APR_SUCCESS) {
211 apr_file_flush(stderr_log);
212 if ((rc = apr_file_dup2(stderr_log, stderr_file, p)) == APR_SUCCESS) {
213 apr_file_close(stderr_file);
216 if (rc != APR_SUCCESS) {
217 ap_log_error(APLOG_MARK, APLOG_CRIT, rc, NULL,
218 "unable to replace stderr with error_log");
223 static void log_child_errfn(apr_pool_t *pool, apr_status_t err,
224 const char *description)
226 ap_log_error(APLOG_MARK, APLOG_ERR, err, NULL,
230 static int log_child(apr_pool_t *p, const char *progname,
233 /* Child process code for 'ErrorLog "|..."';
234 * may want a common framework for this, since I expect it will
235 * be common for other foo-loggers to want this sort of thing...
238 apr_procattr_t *procattr;
241 if (((rc = apr_procattr_create(&procattr, p)) == APR_SUCCESS)
242 && ((rc = apr_procattr_io_set(procattr,
245 APR_NO_PIPE)) == APR_SUCCESS)
246 && ((rc = apr_procattr_error_check_set(procattr, 1)) == APR_SUCCESS)
247 && ((rc = apr_procattr_child_errfn_set(procattr, log_child_errfn)) == APR_SUCCESS)) {
251 apr_tokenize_to_argv(progname, &args, p);
252 pname = apr_pstrdup(p, args[0]);
253 procnew = (apr_proc_t *)apr_pcalloc(p, sizeof(*procnew));
254 rc = apr_proc_create(procnew, pname, (const char * const *)args,
257 if (rc == APR_SUCCESS) {
258 apr_pool_note_subprocess(p, procnew, APR_KILL_AFTER_TIMEOUT);
259 (*fpin) = procnew->in;
266 static int open_error_log(server_rec *s, apr_pool_t *p)
271 if (*s->error_fname == '|') {
272 apr_file_t *dummy = NULL;
274 /* This starts a new process... */
275 rc = log_child (p, s->error_fname + 1, &dummy);
276 if (rc != APR_SUCCESS) {
277 ap_log_error(APLOG_MARK, APLOG_STARTUP, rc, NULL,
278 "Couldn't start ErrorLog process");
282 s->error_log = dummy;
286 else if (!strncasecmp(s->error_fname, "syslog", 6)) {
287 if ((fname = strchr(s->error_fname, ':'))) {
291 for (fac = facilities; fac->t_name; fac++) {
292 if (!strcasecmp(fname, fac->t_name)) {
293 openlog(ap_server_argv0, LOG_NDELAY|LOG_CONS|LOG_PID,
301 openlog(ap_server_argv0, LOG_NDELAY|LOG_CONS|LOG_PID, LOG_LOCAL7);
308 fname = ap_server_root_relative(p, s->error_fname);
310 ap_log_error(APLOG_MARK, APLOG_STARTUP, APR_EBADPATH, NULL,
311 "%s: Invalid error log path %s.",
312 ap_server_argv0, s->error_fname);
315 if ((rc = apr_file_open(&s->error_log, fname,
316 APR_APPEND | APR_READ | APR_WRITE | APR_CREATE,
317 APR_OS_DEFAULT, p)) != APR_SUCCESS) {
318 ap_log_error(APLOG_MARK, APLOG_STARTUP, rc, NULL,
319 "%s: could not open error log file %s.",
320 ap_server_argv0, fname);
328 int ap_open_logs(apr_pool_t *pconf, apr_pool_t *p /* plog */,
329 apr_pool_t *ptemp, server_rec *s_main)
331 apr_status_t rc = APR_SUCCESS;
332 server_rec *virt, *q;
334 apr_file_t *errfile = NULL;
336 if (open_error_log(s_main, p) != OK) {
341 if (s_main->error_log) {
342 /* replace stderr with this new log */
343 apr_file_flush(s_main->error_log);
344 if ((rc = apr_file_open_stderr(&errfile, p)) == APR_SUCCESS) {
345 rc = apr_file_dup2(errfile, s_main->error_log, p);
347 if (rc != APR_SUCCESS) {
348 ap_log_error(APLOG_MARK, APLOG_CRIT, rc, s_main,
349 "unable to replace stderr with error_log");
355 /* note that stderr may still need to be replaced with something
356 * because it points to the old error log, or back to the tty
358 * XXX: This is BS - /dev/null is non-portable
360 if (replace_stderr && freopen("/dev/null", "w", stderr) == NULL) {
361 ap_log_error(APLOG_MARK, APLOG_CRIT, errno, s_main,
362 "unable to replace stderr with /dev/null");
365 for (virt = s_main->next; virt; virt = virt->next) {
366 if (virt->error_fname) {
367 for (q=s_main; q != virt; q = q->next) {
368 if (q->error_fname != NULL
369 && strcmp(q->error_fname, virt->error_fname) == 0) {
375 if (open_error_log(virt, p) != OK) {
380 virt->error_log = q->error_log;
384 virt->error_log = s_main->error_log;
390 AP_DECLARE(void) ap_error_log2stderr(server_rec *s) {
391 apr_file_t *errfile = NULL;
393 apr_file_open_stderr(&errfile, s->process->pool);
394 if (s->error_log != NULL) {
395 apr_file_dup2(s->error_log, errfile, s->process->pool);
399 static void log_error_core(const char *file, int line, int level,
400 apr_status_t status, const server_rec *s,
401 const request_rec *r, apr_pool_t *pool,
402 const char *fmt, va_list args)
404 char errstr[MAX_STRING_LEN];
405 apr_size_t len, errstrlen;
406 apr_file_t *logf = NULL;
408 int level_and_mask = level & APLOG_LEVELMASK;
412 * If we are doing stderr logging (startup), don't log messages that are
413 * above the default server log level unless it is a startup/shutdown
416 if ((level_and_mask != APLOG_NOTICE)
417 && (level_and_mask > ap_default_loglevel)) {
423 else if (s->error_log) {
425 * If we are doing normal logging, don't log messages that are
426 * above the server log level unless it is a startup/shutdown notice
428 if ((level_and_mask != APLOG_NOTICE)
429 && (level_and_mask > s->loglevel)) {
436 else if (tpf_child) {
438 * If we are doing normal logging, don't log messages that are
439 * above the server log level unless it is a startup/shutdown notice
441 if ((level_and_mask != APLOG_NOTICE)
442 && (level_and_mask > s->loglevel)) {
451 * If we are doing syslog logging, don't log messages that are
452 * above the server log level (including a startup/shutdown notice)
454 if (level_and_mask > s->loglevel) {
459 if (logf && ((level & APLOG_STARTUP) != APLOG_STARTUP)) {
461 ap_recent_ctime(errstr + 1, apr_time_now());
462 errstr[1 + APR_CTIME_LEN - 1] = ']';
463 errstr[1 + APR_CTIME_LEN ] = ' ';
464 len = 1 + APR_CTIME_LEN + 1;
469 if ((level & APLOG_STARTUP) != APLOG_STARTUP) {
470 len += apr_snprintf(errstr + len, MAX_STRING_LEN - len,
471 "[%s] ", priorities[level_and_mask].t_name);
475 if (file && level_and_mask == APLOG_DEBUG) {
476 #if defined(_OSD_POSIX) || defined(WIN32)
478 char *e = strrchr(file, '/');
481 e = strrchr(file, '\\');
485 /* In OSD/POSIX, the compiler returns for __FILE__
486 * a string like: __FILE__="*POSIX(/usr/include/stdio.h)"
487 * (it even returns an absolute path for sources in
488 * the current directory). Here we try to strip this
489 * down to the basename.
491 if (e != NULL && e[1] != '\0') {
492 apr_snprintf(tmp, sizeof(tmp), "%s", &e[1]);
493 e = &tmp[strlen(tmp)-1];
499 #endif /*_OSD_POSIX*/
500 len += apr_snprintf(errstr + len, MAX_STRING_LEN - len,
501 "%s(%d): ", file, line);
505 if (r && r->connection) {
506 /* XXX: TODO: add a method of selecting whether logged client
507 * addresses are in dotted quad or resolved form... dotted
508 * quad is the most secure, which is why I'm implementing it
511 len += apr_snprintf(errstr + len, MAX_STRING_LEN - len,
512 "[client %s] ", r->connection->remote_ip);
515 if (status < APR_OS_START_EAIERR) {
516 len += apr_snprintf(errstr + len, MAX_STRING_LEN - len,
519 else if (status < APR_OS_START_SYSERR) {
520 len += apr_snprintf(errstr + len, MAX_STRING_LEN - len,
521 "(EAI %d)", status - APR_OS_START_EAIERR);
523 else if (status < 100000 + APR_OS_START_SYSERR) {
524 len += apr_snprintf(errstr + len, MAX_STRING_LEN - len,
525 "(OS %d)", status - APR_OS_START_SYSERR);
528 len += apr_snprintf(errstr + len, MAX_STRING_LEN - len,
529 "(os 0x%08x)", status - APR_OS_START_SYSERR);
531 apr_strerror(status, errstr + len, MAX_STRING_LEN - len);
532 len += strlen(errstr + len);
533 if (MAX_STRING_LEN - len > 2) {
540 len += apr_vsnprintf(errstr + len, MAX_STRING_LEN - len, fmt, args);
542 if (r && (referer = apr_table_get(r->headers_in, "Referer"))) {
543 len += apr_snprintf(errstr + len, MAX_STRING_LEN - len,
544 ", referer: %s", referer);
547 /* NULL if we are logging to syslog */
549 /* Truncate for the terminator (as apr_snprintf does) */
550 if (len > MAX_STRING_LEN - sizeof(APR_EOL_STR)) {
551 len = MAX_STRING_LEN - sizeof(APR_EOL_STR);
553 strcpy(errstr + len, APR_EOL_STR);
554 apr_file_puts(errstr, logf);
555 apr_file_flush(logf);
559 syslog(level_and_mask, "%s", errstr);
563 ap_run_error_log(file, line, level, status, s, r, pool, errstr + errstrlen);
566 AP_DECLARE(void) ap_log_error(const char *file, int line, int level,
567 apr_status_t status, const server_rec *s,
568 const char *fmt, ...)
573 log_error_core(file, line, level, status, s, NULL, NULL, fmt, args);
577 AP_DECLARE(void) ap_log_perror(const char *file, int line, int level,
578 apr_status_t status, apr_pool_t *p,
579 const char *fmt, ...)
584 log_error_core(file, line, level, status, NULL, NULL, p, fmt, args);
588 AP_DECLARE(void) ap_log_rerror(const char *file, int line, int level,
589 apr_status_t status, const request_rec *r,
590 const char *fmt, ...)
595 log_error_core(file, line, level, status, r->server, r, NULL, fmt, args);
598 * IF APLOG_TOCLIENT is set,
599 * AND the error level is 'warning' or more severe,
600 * AND there isn't already error text associated with this request,
601 * THEN make the message text available to ErrorDocument and
602 * other error processors.
606 if ((level & APLOG_TOCLIENT)
607 && ((level & APLOG_LEVELMASK) <= APLOG_WARNING)
608 && (apr_table_get(r->notes, "error-notes") == NULL)) {
609 apr_table_setn(r->notes, "error-notes",
610 ap_escape_html(r->pool, apr_pvsprintf(r->pool, fmt,
616 AP_DECLARE(void) ap_log_pid(apr_pool_t *p, const char *filename)
618 apr_file_t *pid_file = NULL;
620 static pid_t saved_pid = -1;
629 fname = ap_server_root_relative(p, filename);
631 ap_log_error(APLOG_MARK, APLOG_STARTUP|APLOG_CRIT, APR_EBADPATH,
632 NULL, "Invalid PID file path %s, ignoring.", filename);
637 if (mypid != saved_pid
638 && apr_stat(&finfo, fname, APR_FINFO_MTIME, p) == APR_SUCCESS) {
639 /* AP_SIG_GRACEFUL and HUP call this on each restart.
640 * Only warn on first time through for this pid.
642 * XXX: Could just write first time through too, although
643 * that may screw up scripts written to do something
644 * based on the last modification time of the pid file.
646 ap_log_perror(APLOG_MARK, APLOG_WARNING, 0, p,
647 apr_psprintf(p, "pid file %s overwritten -- Unclean "
648 "shutdown of previous Apache run?",
652 if ((rv = apr_file_open(&pid_file, fname,
653 APR_WRITE | APR_CREATE | APR_TRUNCATE,
654 APR_UREAD | APR_UWRITE | APR_GREAD | APR_WREAD, p))
656 ap_log_error(APLOG_MARK, APLOG_ERR, rv, NULL,
657 "could not create %s", fname);
658 ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL,
659 "%s: could not log pid to file %s",
660 ap_server_argv0, fname);
663 apr_file_printf(pid_file, "%ld" APR_EOL_STR, (long)mypid);
664 apr_file_close(pid_file);
668 AP_DECLARE(apr_status_t) ap_read_pid(apr_pool_t *p, const char *filename,
671 const apr_size_t BUFFER_SIZE = sizeof(long) * 3 + 2; /* see apr_ltoa */
672 apr_file_t *pid_file = NULL;
676 apr_size_t bytes_read;
682 fname = ap_server_root_relative(p, filename);
684 ap_log_error(APLOG_MARK, APLOG_STARTUP|APLOG_CRIT, APR_EBADPATH,
685 NULL, "Invalid PID file path %s, ignoring.", filename);
689 rv = apr_file_open(&pid_file, fname, APR_READ, APR_OS_DEFAULT, p);
690 if (rv != APR_SUCCESS) {
694 /* Ensure null-termination, so that strtol doesn't go crazy. */
695 buf = apr_palloc(p, BUFFER_SIZE);
696 buf[BUFFER_SIZE - 1] = '\0';
698 rv = apr_file_read_full(pid_file, buf, BUFFER_SIZE - 1, &bytes_read);
699 if (rv != APR_SUCCESS && rv != APR_EOF) {
703 /* If we fill the buffer, we're probably reading a corrupt pid file.
704 * To be nice, let's also ensure the first char is a digit. */
705 if (bytes_read == BUFFER_SIZE - 1 || !apr_isdigit(*buf)) {
709 *mypid = strtol(buf, &endptr, 10);
711 apr_file_close(pid_file);
715 AP_DECLARE(void) ap_log_assert(const char *szExp, const char *szFile,
718 char time_str[APR_CTIME_LEN];
720 apr_ctime(time_str, apr_time_now());
721 ap_log_error(APLOG_MARK, APLOG_CRIT, 0, NULL,
722 "[%s] file %s, line %d, assertion \"%s\" failed",
723 time_str, szFile, nLine, szExp);
727 /* unix assert does an abort leading to a core dump */
732 /* piped log support */
734 #ifdef AP_HAVE_RELIABLE_PIPED_LOGS
735 /* forward declaration */
736 static void piped_log_maintenance(int reason, void *data, apr_wait_t status);
738 static int piped_log_spawn(piped_log *pl)
741 apr_procattr_t *procattr;
742 apr_proc_t *procnew = NULL;
745 if (((status = apr_procattr_create(&procattr, pl->p)) != APR_SUCCESS) ||
746 ((status = apr_procattr_child_in_set(procattr,
747 ap_piped_log_read_fd(pl),
748 ap_piped_log_write_fd(pl)))
750 ((status = apr_procattr_child_errfn_set(procattr, log_child_errfn))
752 ((status = apr_procattr_error_check_set(procattr, 1)) != APR_SUCCESS)) {
754 /* Something bad happened, give up and go away. */
755 ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
756 "piped_log_spawn: unable to setup child process '%s': %s",
757 pl->program, apr_strerror(status, buf, sizeof(buf)));
764 apr_tokenize_to_argv(pl->program, &args, pl->p);
765 pname = apr_pstrdup(pl->p, args[0]);
766 procnew = apr_pcalloc(pl->p, sizeof(apr_proc_t));
767 status = apr_proc_create(procnew, pname, (const char * const *) args,
768 NULL, procattr, pl->p);
770 if (status == APR_SUCCESS) {
772 ap_piped_log_write_fd(pl) = procnew->in;
773 apr_proc_other_child_register(procnew, piped_log_maintenance, pl,
774 ap_piped_log_write_fd(pl), pl->p);
778 /* Something bad happened, give up and go away. */
779 ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
780 "unable to start piped log program '%s': %s",
781 pl->program, apr_strerror(status, buf, sizeof(buf)));
790 static void piped_log_maintenance(int reason, void *data, apr_wait_t status)
792 piped_log *pl = data;
796 case APR_OC_REASON_DEATH:
797 case APR_OC_REASON_LOST:
798 ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
799 "piped log program '%s' failed unexpectedly",
802 apr_proc_other_child_unregister(pl);
803 if (pl->program == NULL) {
804 /* during a restart */
807 if ((stats = piped_log_spawn(pl)) != APR_SUCCESS) {
808 /* what can we do? This could be the error log we're having
809 * problems opening up... */
811 ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
812 "piped_log_maintenance: unable to respawn '%s': %s",
813 pl->program, apr_strerror(stats, buf, sizeof(buf)));
817 case APR_OC_REASON_UNWRITABLE:
818 /* We should not kill off the pipe here, since it may only be full.
819 * If it really is locked, we should kill it off manually. */
822 case APR_OC_REASON_RESTART:
824 if (pl->pid != NULL) {
825 apr_proc_kill(pl->pid, SIGTERM);
829 case APR_OC_REASON_UNREGISTER:
835 static apr_status_t piped_log_cleanup_for_exec(void *data)
837 piped_log *pl = data;
839 apr_file_close(ap_piped_log_read_fd(pl));
840 apr_file_close(ap_piped_log_write_fd(pl));
845 static apr_status_t piped_log_cleanup(void *data)
847 piped_log *pl = data;
849 if (pl->pid != NULL) {
850 apr_proc_kill(pl->pid, SIGTERM);
852 return piped_log_cleanup_for_exec(data);
856 AP_DECLARE(piped_log *) ap_open_piped_log(apr_pool_t *p, const char *program)
860 pl = apr_palloc(p, sizeof (*pl));
862 pl->program = apr_pstrdup(p, program);
864 if (apr_file_pipe_create(&ap_piped_log_read_fd(pl),
865 &ap_piped_log_write_fd(pl), p) != APR_SUCCESS) {
868 apr_pool_cleanup_register(p, pl, piped_log_cleanup,
869 piped_log_cleanup_for_exec);
870 if (piped_log_spawn(pl) == -1) {
871 int save_errno = errno;
872 apr_pool_cleanup_kill(p, pl, piped_log_cleanup);
873 apr_file_close(ap_piped_log_read_fd(pl));
874 apr_file_close(ap_piped_log_write_fd(pl));
881 #else /* !AP_HAVE_RELIABLE_PIPED_LOGS */
883 static apr_status_t piped_log_cleanup(void *data)
885 piped_log *pl = data;
887 apr_file_close(ap_piped_log_write_fd(pl));
891 AP_DECLARE(piped_log *) ap_open_piped_log(apr_pool_t *p, const char *program)
894 apr_file_t *dummy = NULL;
897 rc = log_child(p, program, &dummy);
898 if (rc != APR_SUCCESS) {
899 ap_log_error(APLOG_MARK, APLOG_STARTUP, rc, NULL,
900 "Couldn't start piped log process");
904 pl = apr_palloc(p, sizeof (*pl));
906 ap_piped_log_read_fd(pl) = NULL;
907 ap_piped_log_write_fd(pl) = dummy;
908 apr_pool_cleanup_register(p, pl, piped_log_cleanup, piped_log_cleanup);
915 AP_DECLARE(void) ap_close_piped_log(piped_log *pl)
917 apr_pool_cleanup_run(pl->p, pl, piped_log_cleanup);
920 AP_IMPLEMENT_HOOK_VOID(error_log,
921 (const char *file, int line, int level,
922 apr_status_t status, const server_rec *s,
923 const request_rec *r, apr_pool_t *pool,
924 const char *errstr), (file, line, level,
925 status, s, r, pool, errstr))