Return-Path: X-Original-To: apmail-httpd-dev-archive@www.apache.org Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 699AF100B5 for ; Tue, 24 Sep 2013 11:40:19 +0000 (UTC) Received: (qmail 3724 invoked by uid 500); 24 Sep 2013 11:40:16 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 3668 invoked by uid 500); 24 Sep 2013 11:40:15 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 3656 invoked by uid 99); 24 Sep 2013 11:40:13 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Sep 2013 11:40:13 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of trawick@gmail.com designates 209.85.217.181 as permitted sender) Received: from [209.85.217.181] (HELO mail-lb0-f181.google.com) (209.85.217.181) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Sep 2013 11:40:09 +0000 Received: by mail-lb0-f181.google.com with SMTP id u14so3761349lbd.12 for ; Tue, 24 Sep 2013 04:39:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=kSTlXT68aO/XXHG8A+jZbz2pDDKobdnTSvy09E7VmoU=; b=NXyvz+BTvxJP8OT4WvcYzplh1jxakuo5Vr3nquAzJL8AZG9385s0ggkPApFgASMxov e9ZAjUb6fPAhKSUY2FOIHzoKV6LvV5v6V/vDcdZOWXprzNJxGWmlDwIVhvCbKdEYyg3+ BA22bmI/vkmXJYX+yDaqYilW67lyKMHsJP3Wm2VSw1vagePMY9GYlnLOs1DQg1uwRYE2 +UUwHxmBRFxs5VuKnPxVOWe59B2+J9NcrBTzC2+isdTiWQGly6WddrcPhMEPSPhf52oF lqYvkV1zubMMyYG7lMmc3vKS9vPce45vVFsT++g4EZtfkdNU8jt6UgzsJpw2ImQVriff +qQQ== MIME-Version: 1.0 X-Received: by 10.112.156.166 with SMTP id wf6mr23934440lbb.13.1380022786979; Tue, 24 Sep 2013 04:39:46 -0700 (PDT) Received: by 10.114.187.71 with HTTP; Tue, 24 Sep 2013 04:39:46 -0700 (PDT) In-Reply-To: <52417865.9070205@redhat.com> References: <20130923140228.08032238890B@eris.apache.org> <52417865.9070205@redhat.com> Date: Tue, 24 Sep 2013 07:39:46 -0400 Message-ID: Subject: Re: svn commit: r1525597 - in /httpd/httpd/trunk: CHANGES docs/manual/mod/core.xml include/http_core.h include/httpd.h server/core.c server/log.c From: Jeff Trawick To: Apache HTTP Server Development List Content-Type: multipart/alternative; boundary=001a11c18e7afffa4604e71f97e5 X-Virus-Checked: Checked by ClamAV on apache.org --001a11c18e7afffa4604e71f97e5 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Tue, Sep 24, 2013 at 7:32 AM, Jan Kalu=C5=BEa wrote= : > On 09/23/2013 08:39 PM, Jeff Trawick wrote: > >> On Mon, Sep 23, 2013 at 10:02 AM, > > wrote: >> >> Author: jkaluza >> Date: Mon Sep 23 14:02:27 2013 >> New Revision: 1525597 >> >> URL: http://svn.apache.org/r1525597 >> Log: >> Add ap_errorlog_provider to make ErrorLog logging modular. Move >> syslog support from core to new mod_syslog. >> >> >> Since new fields were added to the middle of existing structures, you >> need a major bump to MMN so that existing modules won't load without >> recompile. >> > > Thanks for reviewing my patches. I've fixed the problems you have found i= n > r1525845. > Thank you very much! > > Regards, > Jan Kaluza > > Here's an example of a major bump: >> >> http://svn.apache.org/viewvc/**httpd/httpd/trunk/include/ap_** >> mmn.h?r1=3D1496709&r2=3D1498880&**diff_format=3Dh >> >> >> Modified: >> httpd/httpd/trunk/CHANGES >> httpd/httpd/trunk/docs/manual/**mod/core.xml >> httpd/httpd/trunk/include/**http_core.h >> httpd/httpd/trunk/include/**httpd.h >> httpd/httpd/trunk/server/core.**c >> httpd/httpd/trunk/server/log.c >> >> Modified: httpd/httpd/trunk/CHANGES >> URL: >> http://svn.apache.org/viewvc/**httpd/httpd/trunk/CHANGES?rev=3D** >> 1525597&r1=3D1525596&r2=3D1525597&**view=3Ddiff >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D**=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D** >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- httpd/httpd/trunk/CHANGES [utf-8] (original) >> +++ httpd/httpd/trunk/CHANGES [utf-8] Mon Sep 23 14:02:27 2013 >> @@ -1,6 +1,9 @@ >> -*- >> coding: utf-8 -*- >> Changes with Apache 2.5.0 >> >> + *) core: Add ap_errorlog_provider to make ErrorLog logging >> modular. Move >> + syslog support from core to new mod_syslog. [Jan Kaluza] >> + >> *) mod_proxy_fcgi: Handle reading protocol data that is split >> between >> packets. [Jeff Trawick] >> >> >> Modified: httpd/httpd/trunk/docs/manual/**mod/core.xml >> URL: >> http://svn.apache.org/viewvc/**httpd/httpd/trunk/docs/manual/** >> mod/core.xml?rev=3D1525597&r1=3D**1525596&r2=3D1525597&view=3Ddiff >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D**=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D** >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- httpd/httpd/trunk/docs/manual/**mod/core.xml (original) >> +++ httpd/httpd/trunk/docs/manual/**mod/core.xml Mon Sep 23 14:02:27 >> 2013 >> @@ -1298,16 +1298,19 @@ ErrorDocument 404 /cgi-bin/bad_urls.pl >> >> >> more information.

>> >>

Using syslog instead of a filename enables >> logging >> - via syslogd(8) if the system supports it. The default is to use >> - syslog facility local7, but you can override this = by >> - using the syslog:facility syntax wher= e >> - facility can be one of the names usually documented = in >> + via syslogd(8) if the system supports it and if >> mod_syslog >> + is loaded. The default is to use syslog facility >> local7, >> + but you can override this by using the >> syslog:facility >> + syntax where facility can be one of the names >> usually documented in >> syslog(1). The facility is effectively global, and if it is >> changed >> in individual virtual hosts, the final facility specified >> affects the >> entire server.

>> >> ErrorLog syslog:user >> >> +

Additional modules can provide their own ErrorLog providers. >> The syntax >> + is similar to syslog example above.

>> + >>

SECURITY: See the > href=3D"../misc/security_tips.**html#serverroot">security >> tips >> document for details on why your security could be compromised >> >> Modified: httpd/httpd/trunk/include/**http_core.h >> URL: >> http://svn.apache.org/viewvc/**httpd/httpd/trunk/include/** >> http_core.h?rev=3D1525597&r1=3D**1525596&r2=3D1525597&view=3Ddiff >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D**=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D** >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- httpd/httpd/trunk/include/**http_core.h (original) >> +++ httpd/httpd/trunk/include/**http_core.h Mon Sep 23 14:02:27 2013 >> @@ -833,8 +833,8 @@ typedef struct ap_errorlog_info { >> /** apr error status related to the log message, 0 if no error >> */ >> apr_status_t status; >> >> - /** 1 if logging to syslog, 0 otherwise */ >> - int using_syslog; >> + /** 1 if logging using provider, 0 otherwise */ >> + int using_provider; >> /** 1 if APLOG_STARTUP was set for the log message, 0 otherwis= e >> */ >> int startup; >> >> @@ -842,6 +842,30 @@ typedef struct ap_errorlog_info { >> const char *format; >> } ap_errorlog_info; >> >> +#define AP_ERRORLOG_PROVIDER_GROUP "error_log_writer" >> +#define AP_ERRORLOG_PROVIDER_VERSION "0" >> +#define AP_ERRORLOG_DEFAULT_PROVIDER "file" >> + >> +typedef struct ap_errorlog_provider ap_errorlog_provider; >> + >> +struct ap_errorlog_provider { >> + /** Initializes the error log writer. >> + * @param p The pool to create any storage from >> + * @param s Server for which the logger is initialized >> + * @return Pointer to handle passed later to writer() function >> + */ >> + void * (*init)(apr_pool_t *p, server_rec *s); >> + >> + /** Logs the error message to external error log. >> + * @param info Context of the error message >> + * @param handle Handle created by init() function >> + * @param errstr Error message >> + * @param len Length of the error message >> + */ >> + apr_status_t (*writer)(const ap_errorlog_info *info, void >> *handle, >> + const char *errstr, int len); >> +}; >> + >> /** >> * callback function prototype for a external errorlog handler >> * @note To avoid unbounded memory usage, these functions must not >> allocate >> >> Modified: httpd/httpd/trunk/include/**httpd.h >> URL: >> http://svn.apache.org/viewvc/**httpd/httpd/trunk/include/** >> httpd.h?rev=3D1525597&r1=3D**1525596&r2=3D1525597&view=3Ddiff >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D**=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D** >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- httpd/httpd/trunk/include/**httpd.h (original) >> +++ httpd/httpd/trunk/include/**httpd.h Mon Sep 23 14:02:27 2013 >> @@ -1245,6 +1245,10 @@ struct server_rec { >> apr_file_t *error_log; >> /** The log level configuration */ >> struct ap_logconf log; >> + /** External error log writer provider */ >> + struct ap_errorlog_provider *errorlog_provider; >> + /** Handle to be passed to external log provider's logging >> method */ >> + void *errorlog_provider_handle; >> >> /* Module-specific configuration for server, and defaults... *= / >> >> >> Modified: httpd/httpd/trunk/server/core.**c >> URL: >> http://svn.apache.org/viewvc/**httpd/httpd/trunk/server/core.** >> c?rev=3D1525597&r1=3D1525596&r2=3D**1525597&view=3Ddiff >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D**=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D** >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- httpd/httpd/trunk/server/core.**c (original) >> +++ httpd/httpd/trunk/server/core.**c Mon Sep 23 14:02:27 2013 >> @@ -48,6 +48,7 @@ >> #include "mod_core.h" >> #include "mod_proxy.h" >> #include "ap_listen.h" >> +#include "ap_provider.h" >> >> #include "mod_so.h" /* for ap_find_loaded_module_symbol */ >> >> @@ -3955,6 +3956,49 @@ static apr_array_header_t *parse_errorlo >> return a; >> } >> >> +static const char *set_errorlog(cmd_parms *cmd, void *dummy, const >> char *arg1, >> + const char *arg2) >> +{ >> + ap_errorlog_provider *provider; >> + cmd->server->errorlog_provider =3D NULL; >> + >> + if (!arg2) { >> + /* Stay backward compatible and check for "syslog" */ >> + if (strncmp("syslog", arg1, 6) =3D=3D 0) { >> + arg2 =3D arg1 + 7; /* skip the ':' if any */ >> + arg1 =3D "syslog"; >> + } >> + else { >> + /* Admin can define only "ErrorLog provider" and we >> should >> + * still handle that using the defined provider, but >> with empty >> + * error_fname. */ >> + provider =3D >> ap_lookup_provider(AP_**ERRORLOG_PROVIDER_GROUP, arg1, >> + >> AP_ERRORLOG_PROVIDER_VERSION); >> + if (provider) { >> + arg2 =3D ""; >> + } >> + else { >> + return set_server_string_slot(cmd, dummy, arg1); >> + } >> + } >> + } >> + >> + if (strcmp("file", arg1) =3D=3D 0) { >> + return set_server_string_slot(cmd, dummy, arg2); >> + } >> + >> + provider =3D ap_lookup_provider(AP_**ERRORLOG_PROVIDER_GROUP, >> arg1, >> + AP_ERRORLOG_PROVIDER_VERSION); >> + if (!provider) { >> + return apr_psprintf(cmd->pool, >> + "Unknown ErrorLog provider: %s", >> + arg1); >> + } >> + >> + cmd->server->errorlog_provider =3D provider; >> + return set_server_string_slot(cmd, dummy, arg2); >> +} >> + >> static const char *set_errorlog_format(cmd_parms *cmd, void *dummy= , >> const char *arg1, const >> char *arg2) >> { >> @@ -4118,7 +4162,7 @@ AP_INIT_TAKE1("ServerRoot", set_server_r >> "Common directory of server-related files (logs, confs, etc.)"), >> AP_INIT_TAKE1("**DefaultRuntimeDir", set_runtime_dir, NULL, >> RSRC_CONF | EXEC_ON_READ, >> "Common directory for run-time files (shared memory, locks, >> etc.)"), >> -AP_INIT_TAKE1("ErrorLog", set_server_string_slot, >> +AP_INIT_TAKE12("ErrorLog", set_errorlog, >> (void *)APR_OFFSETOF(server_rec, error_fname), RSRC_CONF, >> "The filename of the error log"), >> AP_INIT_TAKE12("**ErrorLogFormat", set_errorlog_format, NULL, >> RSRC_CONF, >> @@ -4560,7 +4604,7 @@ AP_DECLARE(int) ap_sys_privileges_handle >> static int check_errorlog_dir(apr_pool_t *p, server_rec *s) >> { >> if (!s->error_fname || s->error_fname[0] =3D=3D '|' >> - || strcmp(s->error_fname, "syslog") =3D=3D 0) { >> + || s->errorlog_provider !=3D NULL) { >> return APR_SUCCESS; >> } >> else { >> @@ -4986,7 +5030,7 @@ static void core_dump_config(apr_pool_t >> apr_file_printf(out, "ServerRoot: \"%s\"\n", ap_server_root); >> tmp =3D ap_server_root_relative(p, sconf->ap_document_root); >> apr_file_printf(out, "Main DocumentRoot: \"%s\"\n", tmp); >> - if (s->error_fname[0] !=3D '|' && strcmp(s->error_fname, >> "syslog") !=3D 0) >> + if (s->error_fname[0] !=3D '|' && s->errorlog_provider =3D=3D N= ULL) >> >> >> Check first for s->error_fname !=3D NULL? >> >> tmp =3D ap_server_root_relative(p, s->error_fname); >> else >> tmp =3D s->error_fname; >> >> Modified: httpd/httpd/trunk/server/log.c >> URL: >> http://svn.apache.org/viewvc/**httpd/httpd/trunk/server/log.** >> c?rev=3D1525597&r1=3D1525596&r2=3D**1525597&view=3Ddiff >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D**=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D** >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- httpd/httpd/trunk/server/log.c (original) >> +++ httpd/httpd/trunk/server/log.c Mon Sep 23 14:02:27 2013 >> @@ -53,6 +53,7 @@ >> #include "http_main.h" >> #include "util_time.h" >> #include "ap_mpm.h" >> +#include "ap_provider.h" >> >> #if HAVE_GETTID >> #include >> @@ -75,71 +76,6 @@ APR_HOOK_STRUCT( >> >> int AP_DECLARE_DATA ap_default_loglevel =3D DEFAULT_LOGLEVEL; >> >> -#ifdef HAVE_SYSLOG >> - >> -static const TRANS facilities[] =3D { >> - {"auth", LOG_AUTH}, >> -#ifdef LOG_AUTHPRIV >> - {"authpriv",LOG_AUTHPRIV}, >> -#endif >> -#ifdef LOG_CRON >> - {"cron", LOG_CRON}, >> -#endif >> -#ifdef LOG_DAEMON >> - {"daemon", LOG_DAEMON}, >> -#endif >> -#ifdef LOG_FTP >> - {"ftp", LOG_FTP}, >> -#endif >> -#ifdef LOG_KERN >> - {"kern", LOG_KERN}, >> -#endif >> -#ifdef LOG_LPR >> - {"lpr", LOG_LPR}, >> -#endif >> -#ifdef LOG_MAIL >> - {"mail", LOG_MAIL}, >> -#endif >> -#ifdef LOG_NEWS >> - {"news", LOG_NEWS}, >> -#endif >> -#ifdef LOG_SYSLOG >> - {"syslog", LOG_SYSLOG}, >> -#endif >> -#ifdef LOG_USER >> - {"user", LOG_USER}, >> -#endif >> -#ifdef LOG_UUCP >> - {"uucp", LOG_UUCP}, >> -#endif >> -#ifdef LOG_LOCAL0 >> - {"local0", LOG_LOCAL0}, >> -#endif >> -#ifdef LOG_LOCAL1 >> - {"local1", LOG_LOCAL1}, >> -#endif >> -#ifdef LOG_LOCAL2 >> - {"local2", LOG_LOCAL2}, >> -#endif >> -#ifdef LOG_LOCAL3 >> - {"local3", LOG_LOCAL3}, >> -#endif >> -#ifdef LOG_LOCAL4 >> - {"local4", LOG_LOCAL4}, >> -#endif >> -#ifdef LOG_LOCAL5 >> - {"local5", LOG_LOCAL5}, >> -#endif >> -#ifdef LOG_LOCAL6 >> - {"local6", LOG_LOCAL6}, >> -#endif >> -#ifdef LOG_LOCAL7 >> - {"local7", LOG_LOCAL7}, >> -#endif >> - {NULL, -1}, >> -}; >> -#endif >> - >> static const TRANS priorities[] =3D { >> {"emerg", APLOG_EMERG}, >> {"alert", APLOG_ALERT}, >> @@ -395,29 +331,10 @@ static int open_error_log(server_rec *s, >> >> s->error_log =3D dummy; >> } >> - >> -#ifdef HAVE_SYSLOG >> - else if (!strncasecmp(s->error_fname, "syslog", 6)) { >> - if ((fname =3D strchr(s->error_fname, ':'))) { >> - const TRANS *fac; >> - >> - fname++; >> - for (fac =3D facilities; fac->t_name; fac++) { >> - if (!strcasecmp(fname, fac->t_name)) { >> - openlog(ap_server_argv0, >> LOG_NDELAY|LOG_CONS|LOG_PID, >> - fac->t_val); >> - s->error_log =3D NULL; >> - return OK; >> - } >> - } >> - } >> - else { >> - openlog(ap_server_argv0, LOG_NDELAY|LOG_CONS|LOG_PID, >> LOG_LOCAL7); >> - } >> - >> + else if (s->errorlog_provider) { >> + s->errorlog_provider_handle =3D s->errorlog_provider->init(= p, >> s); >> s->error_log =3D NULL; >> } >> -#endif >> else { >> fname =3D ap_server_root_relative(p, s->error_fname); >> if (!fname) { >> @@ -904,7 +821,7 @@ AP_DECLARE(void) ap_register_log_hooks(a >> >> /* >> * This is used if no error log format is defined and during >> startup. >> - * It automatically omits the timestamp if logging to syslog. >> + * It automatically omits the timestamp if logging using provider. >> */ >> static int do_errorlog_default(const ap_errorlog_info *info, char >> *buf, >> int buflen, int *errstr_start, int >> *errstr_end, >> @@ -917,7 +834,7 @@ static int do_errorlog_default(const ap_ >> char scratch[MAX_STRING_LEN]; >> #endif >> >> - if (!info->using_syslog && !info->startup) { >> + if (!info->using_provider && !info->startup) { >> buf[len++] =3D '['; >> len +=3D log_ctime(info, "u", buf + len, buflen - len); >> buf[len++] =3D ']'; >> @@ -1076,22 +993,14 @@ static int do_errorlog_format(apr_array_ >> static void write_logline(char *errstr, apr_size_t len, apr_file_t >> *logf, >> int level) >> { >> - /* NULL if we are logging to syslog */ >> - if (logf) { >> - /* Truncate for the terminator (as apr_snprintf does) */ >> - if (len > MAX_STRING_LEN - sizeof(APR_EOL_STR)) { >> - len =3D MAX_STRING_LEN - sizeof(APR_EOL_STR); >> - } >> - strcpy(errstr + len, APR_EOL_STR); >> - apr_file_puts(errstr, logf); >> - apr_file_flush(logf); >> - } >> -#ifdef HAVE_SYSLOG >> - else { >> - syslog(level < LOG_PRIMASK ? level : APLOG_DEBUG, "%.*s", >> - (int)len, errstr); >> - } >> -#endif >> + >> + /* Truncate for the terminator (as apr_snprintf does) */ >> + if (len > MAX_STRING_LEN - sizeof(APR_EOL_STR)) { >> + len =3D MAX_STRING_LEN - sizeof(APR_EOL_STR); >> + } >> + strcpy(errstr + len, APR_EOL_STR); >> + apr_file_puts(errstr, logf); >> + apr_file_flush(logf); >> } >> >> static void log_error_core(const char *file, int line, int >> module_index, >> @@ -1152,7 +1061,7 @@ static void log_error_core(const char *f >> } >> else { >> /* >> - * If we are doing syslog logging, don't log messages >> that are >> + * If we are doing logging using provider, don't log >> messages that are >> * above the module's log level (including a >> startup/shutdown notice) >> */ >> if (level_and_mask > configured_level) { >> @@ -1194,7 +1103,7 @@ static void log_error_core(const char *f >> info.file =3D NULL; >> info.line =3D 0; >> info.status =3D 0; >> - info.using_syslog =3D (logf =3D=3D NULL); >> + info.using_provider=3D (logf =3D=3D NULL); >> info.startup =3D ((level & APLOG_STARTUP) =3D=3D APLOG_S= TARTUP); >> info.format =3D fmt; >> >> @@ -1272,7 +1181,14 @@ static void log_error_core(const char *f >> */ >> continue; >> } >> - write_logline(errstr, len, logf, level_and_mask); >> + >> + if (logf) { >> + write_logline(errstr, len, logf, level_and_mask); >> + } >> + else { >> + s->errorlog_provider->writer(&**info, >> s->errorlog_provider_handle, >> + errstr, len); >> + } >> >> if (done) { >> /* >> >> >> >> >> >> -- >> Born in Roswell... married an alien... >> http://emptyhammock.com/ >> > > --=20 Born in Roswell... married an alien... http://emptyhammock.com/ --001a11c18e7afffa4604e71f97e5 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On Tue, Sep 24, 2013 at 7:32 AM, Jan Kalu=C5=BEa <jkaluz= a@redhat.com> wrote:
On 09/23/2013 08:39 PM, Je= ff Trawick wrote:
On Mon, Sep 23, 2013 at 10:02 AM, <jkaluza@apache.org
<mailto:jkaluza@= apache.org>> wrote:

=C2=A0 =C2=A0 Author: jkaluza
=C2=A0 =C2=A0 Date: Mon Sep 23 14:02:27 2013
=C2=A0 =C2=A0 New Revision: 1525597

=C2=A0 =C2=A0 URL: http://svn.apache.org/r1525597
=C2=A0 =C2=A0 Log:
=C2=A0 =C2=A0 Add ap_errorlog_provider to make ErrorLog logging modular. Mo= ve
=C2=A0 =C2=A0 syslog support from core to new mod_syslog.


Since new fields were added to the middle of existing structures, you
need a major bump to MMN so that existing modules won't load without recompile.

Thanks for reviewing my patches. I've fixed the problems you have found= in r1525845.

Thank you very much!
=C2=A0

Regards,
Jan Kaluza

Here's an example of a major bump:

http:/= /svn.apache.org/viewvc/httpd/httpd/trunk/include/ap_mmn.h?r1= =3D1496709&r2=3D1498880&diff_format=3Dh


=C2=A0 =C2=A0 Modified:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0httpd/httpd/trunk/CHANGES
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0httpd/httpd/trunk/docs/manual/mod/= core.xml
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0httpd/httpd/trunk/include/http_cor= e.h
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0httpd/httpd/trunk/include/httpd.h<= br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0httpd/httpd/trunk/server/core.c =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0httpd/httpd/trunk/server/log.c

=C2=A0 =C2=A0 Modified: httpd/httpd/trunk/CHANGES
=C2=A0 =C2=A0 URL:
=C2=A0 =C2=A0 http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?= rev=3D1525597&r1=3D1525596&r2=3D1525597&view=3Ddi= ff
=C2=A0 =C2=A0 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=C2=A0 =C2=A0 --- httpd/httpd/trunk/CHANGES [utf-8] (original)
=C2=A0 =C2=A0 +++ httpd/httpd/trunk/CHANGES [utf-8] Mon Sep 23 14:02:27 201= 3
=C2=A0 =C2=A0 @@ -1,6 +1,9 @@
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0-*-
=C2=A0 =C2=A0 coding: utf-8 -*-
=C2=A0 =C2=A0 =C2=A0 Changes with Apache 2.5.0

=C2=A0 =C2=A0 + =C2=A0*) core: Add ap_errorlog_provider to make ErrorLog lo= gging
=C2=A0 =C2=A0 modular. Move
=C2=A0 =C2=A0 + =C2=A0 =C2=A0 syslog support from core to new mod_syslog. [= Jan Kaluza]
=C2=A0 =C2=A0 +
=C2=A0 =C2=A0 =C2=A0 =C2=A0 *) mod_proxy_fcgi: Handle reading protocol data= that is split
=C2=A0 =C2=A0 between
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0packets. =C2=A0[Jeff Trawick]


=C2=A0 =C2=A0 Modified: httpd/httpd/trunk/docs/manual/mod/core.xml =C2=A0 =C2=A0 URL:
=C2=A0 =C2=A0 http://svn.apache.org/viewvc/httpd/htt= pd/trunk/docs/manual/mod/core.xml?rev=3D1525597&r1=3D1525= 596&r2=3D1525597&view=3Ddiff
=C2=A0 =C2=A0 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=C2=A0 =C2=A0 --- httpd/httpd/trunk/docs/manual/mod/core.xml (origin= al)
=C2=A0 =C2=A0 +++ httpd/httpd/trunk/docs/manual/mod/core.xml Mon Sep= 23 14:02:27 2013
=C2=A0 =C2=A0 @@ -1298,16 +1298,19 @@ ErrorDocument 404 /cgi-bin/bad_urls.pl
=C2=A0 =C2=A0 <http://b= ad_urls.pl>

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 more information.</p>

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <p>Using <code>syslog</co= de> instead of a filename enables logging
=C2=A0 =C2=A0 - =C2=A0 =C2=A0via syslogd(8) if the system supports it. The = default is to use
=C2=A0 =C2=A0 - =C2=A0 =C2=A0syslog facility <code>local7</code>= ;, but you can override this by
=C2=A0 =C2=A0 - =C2=A0 =C2=A0using the <code>syslog:<var>facili= ty</var></code> syntax where
=C2=A0 =C2=A0 - =C2=A0 =C2=A0<var>facility</var> can be one of = the names usually documented in
=C2=A0 =C2=A0 + =C2=A0 =C2=A0via syslogd(8) if the system supports it and i= f
=C2=A0 =C2=A0 <module>mod_syslog</module>
=C2=A0 =C2=A0 + =C2=A0 =C2=A0is loaded. The default is to use syslog facili= ty
=C2=A0 =C2=A0 <code>local7</code>,
=C2=A0 =C2=A0 + =C2=A0 =C2=A0but you can override this by using the
=C2=A0 =C2=A0 <code>syslog:<var>facility</var><= /code>
=C2=A0 =C2=A0 + =C2=A0 =C2=A0syntax where <var>facility</var> c= an be one of the names
=C2=A0 =C2=A0 usually documented in
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 syslog(1). =C2=A0The facility is effecti= vely global, and if it is
=C2=A0 =C2=A0 changed
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 in individual virtual hosts, the final f= acility specified
=C2=A0 =C2=A0 affects the
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 entire server.</p>

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <highlight language=3D"config&qu= ot;>ErrorLog syslog:user</highlight>

=C2=A0 =C2=A0 + =C2=A0 =C2=A0<p>Additional modules can provide their = own ErrorLog providers.
=C2=A0 =C2=A0 The syntax
=C2=A0 =C2=A0 + =C2=A0 =C2=A0is similar to <code>syslog</code> = example above.</p>
=C2=A0 =C2=A0 +
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <p>SECURITY: See the <a
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 href=3D"../misc/security_tips.html#serverroot">security tips</a>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 document for details on why your securit= y could be compromised

=C2=A0 =C2=A0 Modified: httpd/httpd/trunk/include/http_core.h
=C2=A0 =C2=A0 URL:
=C2=A0 =C2=A0 http://svn.apache.org/viewvc/httpd/httpd/= trunk/include/http_core.h?rev=3D1525597&r1=3D1525596&= r2=3D1525597&view=3Ddiff
=C2=A0 =C2=A0 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=C2=A0 =C2=A0 --- httpd/httpd/trunk/include/http_core.h (original) =C2=A0 =C2=A0 +++ httpd/httpd/trunk/include/http_core.h Mon Sep 23 1= 4:02:27 2013
=C2=A0 =C2=A0 @@ -833,8 +833,8 @@ typedef struct ap_errorlog_info {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /** apr error status related to the log = message, 0 if no error */
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 apr_status_t status;

=C2=A0 =C2=A0 - =C2=A0 =C2=A0/** 1 if logging to syslog, 0 otherwise */
=C2=A0 =C2=A0 - =C2=A0 =C2=A0int using_syslog;
=C2=A0 =C2=A0 + =C2=A0 =C2=A0/** 1 if logging using provider, 0 otherwise *= /
=C2=A0 =C2=A0 + =C2=A0 =C2=A0int using_provider;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /** 1 if APLOG_STARTUP was set for the l= og message, 0 otherwise */
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 int startup;

=C2=A0 =C2=A0 @@ -842,6 +842,30 @@ typedef struct ap_errorlog_info {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 const char *format;
=C2=A0 =C2=A0 =C2=A0 } ap_errorlog_info;

=C2=A0 =C2=A0 +#define AP_ERRORLOG_PROVIDER_GROUP "error_log_writer&qu= ot;
=C2=A0 =C2=A0 +#define AP_ERRORLOG_PROVIDER_VERSION "0"
=C2=A0 =C2=A0 +#define AP_ERRORLOG_DEFAULT_PROVIDER "file"
=C2=A0 =C2=A0 +
=C2=A0 =C2=A0 +typedef struct ap_errorlog_provider ap_errorlog_provider; =C2=A0 =C2=A0 +
=C2=A0 =C2=A0 +struct ap_errorlog_provider {
=C2=A0 =C2=A0 + =C2=A0 =C2=A0/** Initializes the error log writer.
=C2=A0 =C2=A0 + =C2=A0 =C2=A0 * @param p The pool to create any storage fro= m
=C2=A0 =C2=A0 + =C2=A0 =C2=A0 * @param s Server for which the logger is ini= tialized
=C2=A0 =C2=A0 + =C2=A0 =C2=A0 * @return Pointer to handle passed later to w= riter() function
=C2=A0 =C2=A0 + =C2=A0 =C2=A0 */
=C2=A0 =C2=A0 + =C2=A0 =C2=A0void * (*init)(apr_pool_t *p, server_rec *s);<= br> =C2=A0 =C2=A0 +
=C2=A0 =C2=A0 + =C2=A0 =C2=A0/** Logs the error message to external error l= og.
=C2=A0 =C2=A0 + =C2=A0 =C2=A0 * @param info Context of the error message =C2=A0 =C2=A0 + =C2=A0 =C2=A0 * @param handle Handle created by init() func= tion
=C2=A0 =C2=A0 + =C2=A0 =C2=A0 * @param errstr Error message
=C2=A0 =C2=A0 + =C2=A0 =C2=A0 * @param len Length of the error message
=C2=A0 =C2=A0 + =C2=A0 =C2=A0 */
=C2=A0 =C2=A0 + =C2=A0 =C2=A0apr_status_t (*writer)(const ap_errorlog_info = *info, void *handle,
=C2=A0 =C2=A0 + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 const char *errstr, int len);
=C2=A0 =C2=A0 +};
=C2=A0 =C2=A0 +
=C2=A0 =C2=A0 =C2=A0 /**
=C2=A0 =C2=A0 =C2=A0 =C2=A0* callback function prototype for a external err= orlog handler
=C2=A0 =C2=A0 =C2=A0 =C2=A0* @note To avoid unbounded memory usage, these f= unctions must not
=C2=A0 =C2=A0 allocate

=C2=A0 =C2=A0 Modified: httpd/httpd/trunk/include/httpd.h
=C2=A0 =C2=A0 URL:
=C2=A0 =C2=A0 http://svn.apache.org/viewvc/httpd/httpd/trunk/= include/httpd.h?rev=3D1525597&r1=3D1525596&r2=3D15255= 97&view=3Ddiff
=C2=A0 =C2=A0 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=C2=A0 =C2=A0 --- httpd/httpd/trunk/include/httpd.h (original)
=C2=A0 =C2=A0 +++ httpd/httpd/trunk/include/httpd.h Mon Sep 23 14:02= :27 2013
=C2=A0 =C2=A0 @@ -1245,6 +1245,10 @@ struct server_rec {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 apr_file_t *error_log;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /** The log level configuration */
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 struct ap_logconf log;
=C2=A0 =C2=A0 + =C2=A0 =C2=A0/** External error log writer provider */
=C2=A0 =C2=A0 + =C2=A0 =C2=A0struct ap_errorlog_provider *errorlog_provider= ;
=C2=A0 =C2=A0 + =C2=A0 =C2=A0/** Handle to be passed to external log provid= er's logging
=C2=A0 =C2=A0 method */
=C2=A0 =C2=A0 + =C2=A0 =C2=A0void *errorlog_provider_handle;

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* Module-specific configuration for ser= ver, and defaults... */


=C2=A0 =C2=A0 Modified: httpd/httpd/trunk/server/core.c
=C2=A0 =C2=A0 URL:
=C2=A0 =C2=A0 http://svn.apache.org/viewvc/httpd/httpd/trunk/se= rver/core.c?rev=3D1525597&r1=3D1525596&r2=3D1525597&a= mp;view=3Ddiff
=C2=A0 =C2=A0 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=C2=A0 =C2=A0 --- httpd/httpd/trunk/server/core.c (original)
=C2=A0 =C2=A0 +++ httpd/httpd/trunk/server/core.c Mon Sep 23 14:02:2= 7 2013
=C2=A0 =C2=A0 @@ -48,6 +48,7 @@
=C2=A0 =C2=A0 =C2=A0 #include "mod_core.h"
=C2=A0 =C2=A0 =C2=A0 #include "mod_proxy.h"
=C2=A0 =C2=A0 =C2=A0 #include "ap_listen.h"
=C2=A0 =C2=A0 +#include "ap_provider.h"

=C2=A0 =C2=A0 =C2=A0 #include "mod_so.h" /* for ap_find_loaded_mo= dule_symbol */

=C2=A0 =C2=A0 @@ -3955,6 +3956,49 @@ static apr_array_header_t *parse_error= lo
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return a;
=C2=A0 =C2=A0 =C2=A0 }

=C2=A0 =C2=A0 +static const char *set_errorlog(cmd_parms *cmd, void *dummy,= const
=C2=A0 =C2=A0 char *arg1,
=C2=A0 =C2=A0 + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0const char *arg2)
=C2=A0 =C2=A0 +{
=C2=A0 =C2=A0 + =C2=A0 =C2=A0ap_errorlog_provider *provider;
=C2=A0 =C2=A0 + =C2=A0 =C2=A0cmd->server->errorlog_provider =3D NULL;=
=C2=A0 =C2=A0 +
=C2=A0 =C2=A0 + =C2=A0 =C2=A0if (!arg2) {
=C2=A0 =C2=A0 + =C2=A0 =C2=A0 =C2=A0 =C2=A0/* Stay backward compatible and = check for "syslog" */
=C2=A0 =C2=A0 + =C2=A0 =C2=A0 =C2=A0 =C2=A0if (strncmp("syslog", = arg1, 6) =3D=3D 0) {
=C2=A0 =C2=A0 + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0arg2 =3D arg1 + 7;= /* skip the ':' if any */
=C2=A0 =C2=A0 + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0arg1 =3D "sys= log";
=C2=A0 =C2=A0 + =C2=A0 =C2=A0 =C2=A0 =C2=A0}
=C2=A0 =C2=A0 + =C2=A0 =C2=A0 =C2=A0 =C2=A0else {
=C2=A0 =C2=A0 + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* Admin can defin= e only "ErrorLog provider" and we should
=C2=A0 =C2=A0 + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 * still handle th= at using the defined provider, but
=C2=A0 =C2=A0 with empty
=C2=A0 =C2=A0 + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 * error_fname. */=
=C2=A0 =C2=A0 + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0provider =3D
=C2=A0 =C2=A0 ap_lookup_provider(AP_ERRORLOG_PROVIDER_GROUP, arg1, =C2=A0 =C2=A0 +
=C2=A0 =C2=A0 =C2=A0 AP_ERRORLOG_PROVIDER_VERSION);
=C2=A0 =C2=A0 + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (provider) { =C2=A0 =C2=A0 + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0arg2= =3D "";
=C2=A0 =C2=A0 + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
=C2=A0 =C2=A0 + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0else {
=C2=A0 =C2=A0 + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0retu= rn set_server_string_slot(cmd, dummy, arg1);
=C2=A0 =C2=A0 + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
=C2=A0 =C2=A0 + =C2=A0 =C2=A0 =C2=A0 =C2=A0}
=C2=A0 =C2=A0 + =C2=A0 =C2=A0}
=C2=A0 =C2=A0 +
=C2=A0 =C2=A0 + =C2=A0 =C2=A0if (strcmp("file", arg1) =3D=3D 0) {=
=C2=A0 =C2=A0 + =C2=A0 =C2=A0 =C2=A0 =C2=A0return set_server_string_slot(cm= d, dummy, arg2);
=C2=A0 =C2=A0 + =C2=A0 =C2=A0}
=C2=A0 =C2=A0 +
=C2=A0 =C2=A0 + =C2=A0 =C2=A0provider =3D ap_lookup_provider(AP_ERRO= RLOG_PROVIDER_GROUP, arg1,
=C2=A0 =C2=A0 + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0AP_ERRORL= OG_PROVIDER_VERSION);
=C2=A0 =C2=A0 + =C2=A0 =C2=A0if (!provider) {
=C2=A0 =C2=A0 + =C2=A0 =C2=A0 =C2=A0 =C2=A0return apr_psprintf(cmd->pool= ,
=C2=A0 =C2=A0 + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"Unknown ErrorLog provider: %s&q= uot;,
=C2=A0 =C2=A0 + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0arg1);
=C2=A0 =C2=A0 + =C2=A0 =C2=A0}
=C2=A0 =C2=A0 +
=C2=A0 =C2=A0 + =C2=A0 =C2=A0cmd->server->errorlog_provider =3D provi= der;
=C2=A0 =C2=A0 + =C2=A0 =C2=A0return set_server_string_slot(cmd, dummy, arg2= );
=C2=A0 =C2=A0 +}
=C2=A0 =C2=A0 +
=C2=A0 =C2=A0 =C2=A0 static const char *set_errorlog_format(cmd_parms *cmd,= void *dummy,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0const char *arg1, const
=C2=A0 =C2=A0 char *arg2)
=C2=A0 =C2=A0 =C2=A0 {
=C2=A0 =C2=A0 @@ -4118,7 +4162,7 @@ AP_INIT_TAKE1("ServerRoot", s= et_server_r
=C2=A0 =C2=A0 =C2=A0 =C2=A0 "Common directory of server-related files = (logs, confs, etc.)"),
=C2=A0 =C2=A0 =C2=A0 AP_INIT_TAKE1("DefaultRuntimeDir", se= t_runtime_dir, NULL,
=C2=A0 =C2=A0 RSRC_CONF | EXEC_ON_READ,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 "Common directory for run-time files (shar= ed memory, locks, etc.)"),
=C2=A0 =C2=A0 -AP_INIT_TAKE1("ErrorLog", set_server_string_slot,<= br> =C2=A0 =C2=A0 +AP_INIT_TAKE12("ErrorLog", set_errorlog,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (void *)APR_OFFSETOF(server_rec, error_fname), = RSRC_CONF,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 "The filename of the error log"),
=C2=A0 =C2=A0 =C2=A0 AP_INIT_TAKE12("ErrorLogFormat", set_= errorlog_format, NULL, RSRC_CONF,
=C2=A0 =C2=A0 @@ -4560,7 +4604,7 @@ AP_DECLARE(int) ap_sys_privileges_handl= e
=C2=A0 =C2=A0 =C2=A0 static int check_errorlog_dir(apr_pool_t *p, server_re= c *s)
=C2=A0 =C2=A0 =C2=A0 {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (!s->error_fname || s->error_fn= ame[0] =3D=3D '|'
=C2=A0 =C2=A0 - =C2=A0 =C2=A0 =C2=A0 =C2=A0|| strcmp(s->error_fname, &qu= ot;syslog") =3D=3D 0) {
=C2=A0 =C2=A0 + =C2=A0 =C2=A0 =C2=A0 =C2=A0|| s->errorlog_provider !=3D = NULL) {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return APR_SUCCESS;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 else {
=C2=A0 =C2=A0 @@ -4986,7 +5030,7 @@ static void core_dump_config(apr_pool_t=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 apr_file_printf(out, "ServerRoot: \= "%s\"\n", ap_server_root);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 tmp =3D ap_server_root_relative(p, sconf= ->ap_document_root);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 apr_file_printf(out, "Main Document= Root: \"%s\"\n", tmp);
=C2=A0 =C2=A0 - =C2=A0 =C2=A0if (s->error_fname[0] !=3D '|' &= ;& strcmp(s->error_fname,
=C2=A0 =C2=A0 "syslog") !=3D 0)
=C2=A0 =C2=A0 + =C2=A0 =C2=A0if (s->error_fname[0] !=3D '|' &= ;& s->errorlog_provider =3D=3D NULL)


Check first for s->error_fname !=3D NULL?

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 tmp =3D ap_server_root_rel= ative(p, s->error_fname);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 else
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 tmp =3D s->error_fname;=

=C2=A0 =C2=A0 Modified: httpd/httpd/trunk/server/log.c
=C2=A0 =C2=A0 URL:
=C2=A0 =C2=A0 http://svn.apache.org/viewvc/httpd/httpd/trunk/ser= ver/log.c?rev=3D1525597&r1=3D1525596&r2=3D1525597&= ;view=3Ddiff
=C2=A0 =C2=A0 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=C2=A0 =C2=A0 --- httpd/httpd/trunk/server/log.c (original)
=C2=A0 =C2=A0 +++ httpd/httpd/trunk/server/log.c Mon Sep 23 14:02:27 2013 =C2=A0 =C2=A0 @@ -53,6 +53,7 @@
=C2=A0 =C2=A0 =C2=A0 #include "http_main.h"
=C2=A0 =C2=A0 =C2=A0 #include "util_time.h"
=C2=A0 =C2=A0 =C2=A0 #include "ap_mpm.h"
=C2=A0 =C2=A0 +#include "ap_provider.h"

=C2=A0 =C2=A0 =C2=A0 #if HAVE_GETTID
=C2=A0 =C2=A0 =C2=A0 #include <sys/syscall.h>
=C2=A0 =C2=A0 @@ -75,71 +76,6 @@ APR_HOOK_STRUCT(

=C2=A0 =C2=A0 =C2=A0 int AP_DECLARE_DATA ap_default_loglevel =3D DEFAULT_LO= GLEVEL;

=C2=A0 =C2=A0 -#ifdef HAVE_SYSLOG
=C2=A0 =C2=A0 -
=C2=A0 =C2=A0 -static const TRANS facilities[] =3D {
=C2=A0 =C2=A0 - =C2=A0 =C2=A0{"auth", =C2=A0 =C2=A0LOG_AUTH},
=C2=A0 =C2=A0 -#ifdef LOG_AUTHPRIV
=C2=A0 =C2=A0 - =C2=A0 =C2=A0{"authpriv",LOG_AUTHPRIV},
=C2=A0 =C2=A0 -#endif
=C2=A0 =C2=A0 -#ifdef LOG_CRON
=C2=A0 =C2=A0 - =C2=A0 =C2=A0{"cron", =C2=A0 =C2=A0LOG_CRON},
=C2=A0 =C2=A0 -#endif
=C2=A0 =C2=A0 -#ifdef LOG_DAEMON
=C2=A0 =C2=A0 - =C2=A0 =C2=A0{"daemon", =C2=A0LOG_DAEMON},
=C2=A0 =C2=A0 -#endif
=C2=A0 =C2=A0 -#ifdef LOG_FTP
=C2=A0 =C2=A0 - =C2=A0 =C2=A0{"ftp", LOG_FTP},
=C2=A0 =C2=A0 -#endif
=C2=A0 =C2=A0 -#ifdef LOG_KERN
=C2=A0 =C2=A0 - =C2=A0 =C2=A0{"kern", =C2=A0 =C2=A0LOG_KERN},
=C2=A0 =C2=A0 -#endif
=C2=A0 =C2=A0 -#ifdef LOG_LPR
=C2=A0 =C2=A0 - =C2=A0 =C2=A0{"lpr", LOG_LPR},
=C2=A0 =C2=A0 -#endif
=C2=A0 =C2=A0 -#ifdef LOG_MAIL
=C2=A0 =C2=A0 - =C2=A0 =C2=A0{"mail", =C2=A0 =C2=A0LOG_MAIL},
=C2=A0 =C2=A0 -#endif
=C2=A0 =C2=A0 -#ifdef LOG_NEWS
=C2=A0 =C2=A0 - =C2=A0 =C2=A0{"news", =C2=A0 =C2=A0LOG_NEWS},
=C2=A0 =C2=A0 -#endif
=C2=A0 =C2=A0 -#ifdef LOG_SYSLOG
=C2=A0 =C2=A0 - =C2=A0 =C2=A0{"syslog", =C2=A0LOG_SYSLOG},
=C2=A0 =C2=A0 -#endif
=C2=A0 =C2=A0 -#ifdef LOG_USER
=C2=A0 =C2=A0 - =C2=A0 =C2=A0{"user", =C2=A0 =C2=A0LOG_USER},
=C2=A0 =C2=A0 -#endif
=C2=A0 =C2=A0 -#ifdef LOG_UUCP
=C2=A0 =C2=A0 - =C2=A0 =C2=A0{"uucp", =C2=A0 =C2=A0LOG_UUCP},
=C2=A0 =C2=A0 -#endif
=C2=A0 =C2=A0 -#ifdef LOG_LOCAL0
=C2=A0 =C2=A0 - =C2=A0 =C2=A0{"local0", =C2=A0LOG_LOCAL0},
=C2=A0 =C2=A0 -#endif
=C2=A0 =C2=A0 -#ifdef LOG_LOCAL1
=C2=A0 =C2=A0 - =C2=A0 =C2=A0{"local1", =C2=A0LOG_LOCAL1},
=C2=A0 =C2=A0 -#endif
=C2=A0 =C2=A0 -#ifdef LOG_LOCAL2
=C2=A0 =C2=A0 - =C2=A0 =C2=A0{"local2", =C2=A0LOG_LOCAL2},
=C2=A0 =C2=A0 -#endif
=C2=A0 =C2=A0 -#ifdef LOG_LOCAL3
=C2=A0 =C2=A0 - =C2=A0 =C2=A0{"local3", =C2=A0LOG_LOCAL3},
=C2=A0 =C2=A0 -#endif
=C2=A0 =C2=A0 -#ifdef LOG_LOCAL4
=C2=A0 =C2=A0 - =C2=A0 =C2=A0{"local4", =C2=A0LOG_LOCAL4},
=C2=A0 =C2=A0 -#endif
=C2=A0 =C2=A0 -#ifdef LOG_LOCAL5
=C2=A0 =C2=A0 - =C2=A0 =C2=A0{"local5", =C2=A0LOG_LOCAL5},
=C2=A0 =C2=A0 -#endif
=C2=A0 =C2=A0 -#ifdef LOG_LOCAL6
=C2=A0 =C2=A0 - =C2=A0 =C2=A0{"local6", =C2=A0LOG_LOCAL6},
=C2=A0 =C2=A0 -#endif
=C2=A0 =C2=A0 -#ifdef LOG_LOCAL7
=C2=A0 =C2=A0 - =C2=A0 =C2=A0{"local7", =C2=A0LOG_LOCAL7},
=C2=A0 =C2=A0 -#endif
=C2=A0 =C2=A0 - =C2=A0 =C2=A0{NULL, =C2=A0 =C2=A0 =C2=A0-1},
=C2=A0 =C2=A0 -};
=C2=A0 =C2=A0 -#endif
=C2=A0 =C2=A0 -
=C2=A0 =C2=A0 =C2=A0 static const TRANS priorities[] =3D {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {"emerg", =C2=A0 APLOG_EMERG},=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {"alert", =C2=A0 APLOG_ALERT},=
=C2=A0 =C2=A0 @@ -395,29 +331,10 @@ static int open_error_log(server_rec *s= ,

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 s->error_log =3D dummy;=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
=C2=A0 =C2=A0 -
=C2=A0 =C2=A0 -#ifdef HAVE_SYSLOG
=C2=A0 =C2=A0 - =C2=A0 =C2=A0else if (!strncasecmp(s->error_fname, "= ;syslog", 6)) {
=C2=A0 =C2=A0 - =C2=A0 =C2=A0 =C2=A0 =C2=A0if ((fname =3D strchr(s->erro= r_fname, ':'))) {
=C2=A0 =C2=A0 - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0const TRANS *fac;<= br> =C2=A0 =C2=A0 -
=C2=A0 =C2=A0 - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0fname++;
=C2=A0 =C2=A0 - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0for (fac =3D facil= ities; fac->t_name; fac++) {
=C2=A0 =C2=A0 - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (= !strcasecmp(fname, fac->t_name)) {
=C2=A0 =C2=A0 - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0openlog(ap_server_argv0,
=C2=A0 =C2=A0 LOG_NDELAY|LOG_CONS|LOG_PID,
=C2=A0 =C2=A0 - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0fac->t_val);
=C2=A0 =C2=A0 - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0s->error_log =3D NULL;
=C2=A0 =C2=A0 - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0return OK;
=C2=A0 =C2=A0 - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} =C2=A0 =C2=A0 - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
=C2=A0 =C2=A0 - =C2=A0 =C2=A0 =C2=A0 =C2=A0}
=C2=A0 =C2=A0 - =C2=A0 =C2=A0 =C2=A0 =C2=A0else {
=C2=A0 =C2=A0 - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0openlog(ap_server_= argv0, LOG_NDELAY|LOG_CONS|LOG_PID,
=C2=A0 =C2=A0 LOG_LOCAL7);
=C2=A0 =C2=A0 - =C2=A0 =C2=A0 =C2=A0 =C2=A0}
=C2=A0 =C2=A0 -
=C2=A0 =C2=A0 + =C2=A0 =C2=A0else if (s->errorlog_provider) {
=C2=A0 =C2=A0 + =C2=A0 =C2=A0 =C2=A0 =C2=A0s->errorlog_provider_handle = =3D s->errorlog_provider->init(p, s);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 s->error_log =3D NULL;<= br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
=C2=A0 =C2=A0 -#endif
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 else {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 fname =3D ap_server_root_r= elative(p, s->error_fname);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (!fname) {
=C2=A0 =C2=A0 @@ -904,7 +821,7 @@ AP_DECLARE(void) ap_register_log_hooks(a<= br>
=C2=A0 =C2=A0 =C2=A0 /*
=C2=A0 =C2=A0 =C2=A0 =C2=A0* This is used if no error log format is defined= and during startup.
=C2=A0 =C2=A0 - * It automatically omits the timestamp if logging to syslog= .
=C2=A0 =C2=A0 + * It automatically omits the timestamp if logging using pro= vider.
=C2=A0 =C2=A0 =C2=A0 =C2=A0*/
=C2=A0 =C2=A0 =C2=A0 static int do_errorlog_default(const ap_errorlog_info = *info, char
=C2=A0 =C2=A0 *buf,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0int buflen, int = *errstr_start, int
=C2=A0 =C2=A0 *errstr_end,
=C2=A0 =C2=A0 @@ -917,7 +834,7 @@ static int do_errorlog_default(const ap_<= br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 char scratch[MAX_STRING_LEN];
=C2=A0 =C2=A0 =C2=A0 #endif

=C2=A0 =C2=A0 - =C2=A0 =C2=A0if (!info->using_syslog && !info-&g= t;startup) {
=C2=A0 =C2=A0 + =C2=A0 =C2=A0if (!info->using_provider && !info-= >startup) {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 buf[len++] =3D '['= ;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 len +=3D log_ctime(info, &= quot;u", buf + len, buflen - len);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 buf[len++] =3D ']'= ;
=C2=A0 =C2=A0 @@ -1076,22 +993,14 @@ static int do_errorlog_format(apr_arra= y_
=C2=A0 =C2=A0 =C2=A0 static void write_logline(char *errstr, apr_size_t len= , apr_file_t
=C2=A0 =C2=A0 *logf,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 int level)
=C2=A0 =C2=A0 =C2=A0 {
=C2=A0 =C2=A0 - =C2=A0 =C2=A0/* NULL if we are logging to syslog */
=C2=A0 =C2=A0 - =C2=A0 =C2=A0if (logf) {
=C2=A0 =C2=A0 - =C2=A0 =C2=A0 =C2=A0 =C2=A0/* Truncate for the terminator (= as apr_snprintf does) */
=C2=A0 =C2=A0 - =C2=A0 =C2=A0 =C2=A0 =C2=A0if (len > MAX_STRING_LEN - si= zeof(APR_EOL_STR)) {
=C2=A0 =C2=A0 - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0len =3D MAX_STRING= _LEN - sizeof(APR_EOL_STR);
=C2=A0 =C2=A0 - =C2=A0 =C2=A0 =C2=A0 =C2=A0}
=C2=A0 =C2=A0 - =C2=A0 =C2=A0 =C2=A0 =C2=A0strcpy(errstr + len, APR_EOL_STR= );
=C2=A0 =C2=A0 - =C2=A0 =C2=A0 =C2=A0 =C2=A0apr_file_puts(errstr, logf);
=C2=A0 =C2=A0 - =C2=A0 =C2=A0 =C2=A0 =C2=A0apr_file_flush(logf);
=C2=A0 =C2=A0 - =C2=A0 =C2=A0}
=C2=A0 =C2=A0 -#ifdef HAVE_SYSLOG
=C2=A0 =C2=A0 - =C2=A0 =C2=A0else {
=C2=A0 =C2=A0 - =C2=A0 =C2=A0 =C2=A0 =C2=A0syslog(level < LOG_PRIMASK ? = level : APLOG_DEBUG, "%.*s",
=C2=A0 =C2=A0 - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (int)len, = errstr);
=C2=A0 =C2=A0 - =C2=A0 =C2=A0}
=C2=A0 =C2=A0 -#endif
=C2=A0 =C2=A0 +
=C2=A0 =C2=A0 + =C2=A0 =C2=A0/* Truncate for the terminator (as apr_snprint= f does) */
=C2=A0 =C2=A0 + =C2=A0 =C2=A0if (len > MAX_STRING_LEN - sizeof(APR_EOL_S= TR)) {
=C2=A0 =C2=A0 + =C2=A0 =C2=A0 =C2=A0 =C2=A0len =3D MAX_STRING_LEN - sizeof(= APR_EOL_STR);
=C2=A0 =C2=A0 + =C2=A0 =C2=A0}
=C2=A0 =C2=A0 + =C2=A0 =C2=A0strcpy(errstr + len, APR_EOL_STR);
=C2=A0 =C2=A0 + =C2=A0 =C2=A0apr_file_puts(errstr, logf);
=C2=A0 =C2=A0 + =C2=A0 =C2=A0apr_file_flush(logf);
=C2=A0 =C2=A0 =C2=A0 }

=C2=A0 =C2=A0 =C2=A0 static void log_error_core(const char *file, int line,= int
=C2=A0 =C2=A0 module_index,
=C2=A0 =C2=A0 @@ -1152,7 +1061,7 @@ static void log_error_core(const char *= f
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 else {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /*
=C2=A0 =C2=A0 - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 * If we are doing= syslog logging, don't log messages
=C2=A0 =C2=A0 that are
=C2=A0 =C2=A0 + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 * If we are doing= logging using provider, don't log
=C2=A0 =C2=A0 messages that are
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0* abov= e the module's log level (including a
=C2=A0 =C2=A0 startup/shutdown notice)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*/
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (level_an= d_mask > configured_level) {
=C2=A0 =C2=A0 @@ -1194,7 +1103,7 @@ static void log_error_core(const char *= f
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 info.file =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0=3D NULL;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 info.line =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0=3D 0;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 info.status =C2=A0 =C2=A0 =C2=A0 =C2=A0= =3D 0;
=C2=A0 =C2=A0 - =C2=A0 =C2=A0info.using_syslog =C2=A0=3D (logf =3D=3D NULL)= ;
=C2=A0 =C2=A0 + =C2=A0 =C2=A0info.using_provider=3D (logf =3D=3D NULL);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 info.startup =C2=A0 =C2=A0 =C2=A0 =3D ((= level & APLOG_STARTUP) =3D=3D APLOG_STARTUP);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 info.format =C2=A0 =C2=A0 =C2=A0 =C2=A0= =3D fmt;

=C2=A0 =C2=A0 @@ -1272,7 +1181,14 @@ static void log_error_core(const char = *f
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*/
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 continue; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
=C2=A0 =C2=A0 - =C2=A0 =C2=A0 =C2=A0 =C2=A0write_logline(errstr, len, logf,= level_and_mask);
=C2=A0 =C2=A0 +
=C2=A0 =C2=A0 + =C2=A0 =C2=A0 =C2=A0 =C2=A0if (logf) {
=C2=A0 =C2=A0 + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0write_logline(errs= tr, len, logf, level_and_mask);
=C2=A0 =C2=A0 + =C2=A0 =C2=A0 =C2=A0 =C2=A0}
=C2=A0 =C2=A0 + =C2=A0 =C2=A0 =C2=A0 =C2=A0else {
=C2=A0 =C2=A0 + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0s->errorlog_pro= vider->writer(&info,
=C2=A0 =C2=A0 s->errorlog_provider_handle,
=C2=A0 =C2=A0 + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 errstr, len);
=C2=A0 =C2=A0 + =C2=A0 =C2=A0 =C2=A0 =C2=A0}

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (done) {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /*





--
Born in Roswell... married an alien...
http://emptyhammock.= com/




--
Born in Rosw= ell... married an alien...
http://emptyhammock.com/
--001a11c18e7afffa4604e71f97e5--