log.c revision cf8fe49d9d89cfa4b62cb2b1376ca6f25b81b362
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim/* ====================================================================
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim * The Apache Software License, Version 1.1
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim * Copyright (c) 2000-2002 The Apache Software Foundation. All rights
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim * reserved.
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim * Redistribution and use in source and binary forms, with or without
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim * modification, are permitted provided that the following conditions
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim * are met:
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim * 1. Redistributions of source code must retain the above copyright
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim * notice, this list of conditions and the following disclaimer.
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim * 2. Redistributions in binary form must reproduce the above copyright
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim * notice, this list of conditions and the following disclaimer in
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim * the documentation and/or other materials provided with the
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim * distribution.
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim * 3. The end-user documentation included with the redistribution,
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim * if any, must include the following acknowledgment:
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim * "This product includes software developed by the
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim * Apache Software Foundation (http://www.apache.org/)."
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim * Alternately, this acknowledgment may appear in the software itself,
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim * if and wherever such third-party acknowledgments normally appear.
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim * 4. The names "Apache" and "Apache Software Foundation" must
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim * not be used to endorse or promote products derived from this
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim * software without prior written permission. For written
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim * permission, please contact apache@apache.org.
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim * 5. Products derived from this software may not be called "Apache",
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim * nor may "Apache" appear in their name, without prior written
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim * permission of the Apache Software Foundation.
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim * SUCH DAMAGE.
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim * ====================================================================
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim * This software consists of voluntary contributions made by many
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim * individuals on behalf of the Apache Software Foundation. For more
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim * information on the Apache Software Foundation, please see
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim * Portions of this software are based upon public domain software
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim * originally written at the National Center for Supercomputing Applications,
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim * University of Illinois, Urbana-Champaign.
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim * http_log.c: Dealing with the logs and errors
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim * Rob McCool
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jimtypedef struct {
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jimint AP_DECLARE_DATA ap_default_loglevel = DEFAULT_LOGLEVEL;
char **args;
const char *pname;
return rc;
const char *fname;
int rc;
#ifdef HAVE_SYSLOG
fname++;
if (!fname) {
int replace_stderr;
replace_stderr = 0;
if (q == virt) {
const char *referer;
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) {
if (logf) {
#ifdef HAVE_SYSLOG
const char *fmt, ...)
const char *fmt, ...)
const char *fmt, ...)
args)));
const char *fname;
if (!filename) {
if (!fname) {
fname));
!= APR_SUCCESS) {
int nLine)
#if defined(WIN32)
DebugBreak();
abort();
#ifdef AP_HAVE_RELIABLE_PIPED_LOGS
int rc;
!= APR_SUCCESS)) {
char **args;
const char *pname;
switch (reason) {
case APR_OC_REASON_DEATH:
case APR_OC_REASON_LOST:
case APR_OC_REASON_UNWRITABLE:
case APR_OC_REASON_RESTART:
case APR_OC_REASON_UNREGISTER:
return APR_SUCCESS;
pl->p = p;
return NULL;
return NULL;
return pl;
return APR_SUCCESS;
int rc;
pl->p = p;
return pl;