log.c revision 6db54801798f6021bb464de7b3fdcc9dc3150f7b
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering/* ====================================================================
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * Copyright (c) 1995-1999 The Apache Group. All rights reserved.
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * Redistribution and use in source and binary forms, with or without
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * modification, are permitted provided that the following conditions
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * 1. Redistributions of source code must retain the above copyright
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * notice, this list of conditions and the following disclaimer.
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * 2. Redistributions in binary form must reproduce the above copyright
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * notice, this list of conditions and the following disclaimer in
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * the documentation and/or other materials provided with the
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * distribution.
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * 3. All advertising materials mentioning features or use of this
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * software must display the following acknowledgment:
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * "This product includes software developed by the Apache Group
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * for use in the Apache HTTP server project (http://www.apache.org/)."
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * 4. The names "Apache Server" and "Apache Group" must not be used to
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * endorse or promote products derived from this software without
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * prior written permission. For written permission, please contact
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * apache@apache.org.
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * 5. Products derived from this software may not be called "Apache"
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * nor may "Apache" appear in their names without prior written
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * permission of the Apache Group.
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * 6. Redistributions of any form whatsoever must retain the following
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * acknowledgment:
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * "This product includes software developed by the Apache Group
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * for use in the Apache HTTP server project (http://www.apache.org/)."
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE GROUP OR
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * OF THE POSSIBILITY OF SUCH DAMAGE.
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * ====================================================================
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * This software consists of voluntary contributions made by many
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * individuals on behalf of the Apache Group and was originally based
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * on public domain software written at the National Center for
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * Supercomputing Applications, University of Illinois, Urbana-Champaign.
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * For more information on the Apache Group and the Apache HTTP server
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * project, please see <http://www.apache.org/>.
e83bebeff7d9d734e17c3e38ac13daabc09518e1Lennart Poettering * http_log.c: Dealing with the logs and errors
#include "http_log.h"
#include "http_main.h"
#include <stdarg.h>
char *t_name;
int t_val;
} TRANS;
#ifdef HAVE_SYSLOG
#ifdef LOG_AUTHPRIV
#ifdef LOG_CRON
#ifdef LOG_DAEMON
#ifdef LOG_FTP
#ifdef LOG_KERN
#ifdef LOG_LPR
#ifdef LOG_MAIL
#ifdef LOG_NEWS
#ifdef LOG_SYSLOG
#ifdef LOG_USER
#ifdef LOG_UUCP
#ifdef LOG_LOCAL0
#ifdef LOG_LOCAL1
#ifdef LOG_LOCAL2
#ifdef LOG_LOCAL3
#ifdef LOG_LOCAL4
#ifdef LOG_LOCAL5
#ifdef LOG_LOCAL6
#ifdef LOG_LOCAL7
#ifdef SIGHUP
return(rc);
const char *fname;
int rc;
#ifdef HAVE_SYSLOG
fname++;
int replace_stderr;
replace_stderr = 0;
if (q == virt)
if (s == NULL) {
else if (s->error_log) {
#ifdef TPF
else if (tpf_child) {
len = 0;
#ifndef TPF
#ifdef _OSD_POSIX
if (r && r->connection) {
&& (status != 0)
#ifdef WIN32
#ifdef WIN32
int nChars;
int nErrorCode;
NULL,
if (nChars == 0) {
len--;
if (logf) {
#ifdef HAVE_SYSLOG
const char *fmt, ...)
const char *fmt, ...)
if (!fname)
ap_psprintf(p,
file,
reason);
#ifndef WIN32
abort();
#ifdef HAVE_RELIABLE_PIPED_LOGS
int rc;
#ifdef SIGHUP
switch (reason) {
case OC_REASON_DEATH:
case OC_REASON_LOST:
case OC_REASON_UNWRITABLE:
case OC_REASON_RESTART:
case OC_REASON_UNREGISTER:
return APR_SUCCESS;
return APR_SUCCESS;
pl->p = p;
return NULL;
return NULL;
return pl;
int rc;
pl->p = p;
return pl;