log.c revision 917a794f7b32c11ae63b4d23c3b233e52eab0adf
dc0d8d65d35787d30a275895ccad8d8e1b58a5ednd/* Licensed to the Apache Software Foundation (ASF) under one or more
dc0d8d65d35787d30a275895ccad8d8e1b58a5ednd * contributor license agreements. See the NOTICE file distributed with
dc0d8d65d35787d30a275895ccad8d8e1b58a5ednd * this work for additional information regarding copyright ownership.
dc0d8d65d35787d30a275895ccad8d8e1b58a5ednd * The ASF licenses this file to You under the Apache License, Version 2.0
dc0d8d65d35787d30a275895ccad8d8e1b58a5ednd * (the "License"); you may not use this file except in compliance with
dc0d8d65d35787d30a275895ccad8d8e1b58a5ednd * the License. You may obtain a copy of the License at
* http_log.c: Dealing with the logs and errors
#include "apr.h"
#include "apr_strings.h"
#include "apr_errno.h"
#include "apr_thread_proc.h"
#include "apr_lib.h"
#include "apr_signal.h"
#define APR_WANT_STDIO
#define APR_WANT_STRFUNC
#include "apr_want.h"
#include <stdarg.h>
#include <unistd.h>
#include "ap_config.h"
#include "httpd.h"
#include "http_config.h"
#include "http_core.h"
#include "http_log.h"
#include "http_main.h"
#include "util_time.h"
#include "ap_mpm.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
typedef struct read_handle_t {
return APR_SUCCESS;
#ifndef WIN32
while (cur) {
const char *fname)
if (!filename) {
fname);
return APR_EBADPATH;
return rc;
if (!stderr_pool) {
stderr_pool = p;
== APR_SUCCESS) {
== APR_SUCCESS) {
if (stderr_pool == p)
return rc;
const char *description)
== APR_SUCCESS)) {
char **args;
const char *pname;
if (dummy_stderr) {
return rc;
const char *fname;
int rc;
if (!fname) {
return DONE;
fname);
return DONE;
#ifdef HAVE_SYSLOG
fname++;
return OK;
if (!fname) {
return DONE;
return DONE;
return OK;
int replace_stderr;
return DONE;
if (stderr_pool)
replace_stderr = 0;
if (q == virt) {
return DONE;
return OK;
const conn_rec *c,
#ifndef AP_UNSAFE_ERROR_LOG_UNESCAPED
const char *referer;
if (r && r->connection) {
c = r->connection;
if (s == NULL) {
#ifndef DEBUG
else if (s->error_log) {
len = 0;
#ifdef WIN32
if (status != 0) {
#ifndef AP_UNSAFE_ERROR_LOG_UNESCAPED
#ifndef AP_UNSAFE_ERROR_LOG_UNESCAPED
#ifndef AP_UNSAFE_ERROR_LOG_UNESCAPED
if (logf) {
#ifdef HAVE_SYSLOG
const char *fmt, ...)
const char *fmt, ...)
const char *fmt, ...)
args);
args)));
const char *fmt, ...)
const char *fname;
if (!filename) {
if (!fname) {
fname);
!= APR_SUCCESS) {
const char *fname;
if (!filename) {
return APR_EGENERAL;
if (!fname) {
return APR_EGENERAL;
return rv;
return rv;
return APR_EGENERAL;
return APR_SUCCESS;
int nLine)
#if defined(WIN32)
DebugBreak();
abort();
#ifdef AP_HAVE_RELIABLE_PIPED_LOGS
!= APR_SUCCESS) ||
!= APR_SUCCESS) ||
char **args;
const char *pname;
return status;
int mpm_state;
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;
return NULL;
pl->p = p;
return pl;