httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jkal...@apache.org
Subject svn commit: r1675797 - in /httpd/httpd/trunk: docs/manual/mod/mod_journald.xml modules/loggers/mod_journald.c
Date Fri, 24 Apr 2015 06:56:44 GMT
Author: jkaluza
Date: Fri Apr 24 06:56:43 2015
New Revision: 1675797

URL: http://svn.apache.org/r1675797
Log:
* mod_journald: Remove JournaldCustomLog. It is not needed now when
  mod_log_config can use mod_journald as errorlog provider.

Modified:
    httpd/httpd/trunk/docs/manual/mod/mod_journald.xml
    httpd/httpd/trunk/modules/loggers/mod_journald.c

Modified: httpd/httpd/trunk/docs/manual/mod/mod_journald.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_journald.xml?rev=1675797&r1=1675796&r2=1675797&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/mod_journald.xml (original)
+++ httpd/httpd/trunk/docs/manual/mod/mod_journald.xml Fri Apr 24 06:56:43 2015
@@ -79,29 +79,21 @@
 ErrorLog journald
     </highlight>
 
-</section>
-
-
-<directivesynopsis>
-<name>JournaldCustomLog</name>
-<description>Enable logging of CustomLog/TransferLog to systemd-journald</description>
-<syntax>JournaldCustomLog on|off</syntax>
-<default>JournaldCustomLog off</default>
-<contextlist><context>server config</context></contextlist>
-
-<usage>
-
-    <p>The <directive>JournaldCustomLog</directive> directive enables logging
-    of CustomLog and TransferLog messages to systemd-journald.
+    <p>Using <code>journald</code> as an error log provider in CustomLog
+    directive (see <module>mod_log_config</module>) enables
+    logging via systemd-journald(8) if the system supports it.
     </p>
 
+    <highlight language="config">
+CustomLog "journald" "%h %l %u %t \"%r\" %>s %b"
+    </highlight>
+
     <note type="warning"><title>Performance warning</title><p>
     Currently, systemd-journald is not designed for high-throughput logging
     and logging access_log to systemd-journald could decrease the performance
     a lot.
     </p></note>
-</usage>
-</directivesynopsis>
 
+</section>
 
 </modulesynopsis>

Modified: httpd/httpd/trunk/modules/loggers/mod_journald.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/loggers/mod_journald.c?rev=1675797&r1=1675796&r2=1675797&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/loggers/mod_journald.c (original)
+++ httpd/httpd/trunk/modules/loggers/mod_journald.c Fri Apr 24 06:56:43 2015
@@ -40,8 +40,6 @@
 
 #define MAX_ENTRIES 15
 
-static int handle_custom_log = 0;
-
 static int journald_info_get_priority(int level)
 {
     switch(level) {
@@ -176,64 +174,6 @@ static const char *journald_error_log_pa
     return NULL;
 }
 
-static apr_status_t journald_log_writer(request_rec *r,
-                           void *handle,
-                           const char **strs,
-                           int *strl,
-                           int nelts,
-                           apr_size_t len)
-
-{
-    char *str;
-    char *s;
-    int i;
-    apr_status_t rv = APR_SUCCESS;
-
-    str = apr_palloc(r->pool, len + 1);
-
-    /* Last string is always \n, so skipt it */
-    for (i = 0, s = str; i < nelts - 1; ++i) {
-        memcpy(s, strs[i], strl[i]);
-        s += strl[i];
-    }
-
-    journald_log(r->pool, (char *) handle, str, len,
-                 LOG_INFO, r->server, r);
-
-    return rv;
-}
-
-static void *journald_log_writer_init(apr_pool_t *p, server_rec *s,
-                                        const char* name)
-{
-    char *log_name = apr_pstrdup(p, name);
-    return log_name;
-}
-
-static int journald_open_logs(apr_pool_t *p, apr_pool_t *plog,
-                               apr_pool_t *ptemp, server_rec *s)
-{
-    APR_OPTIONAL_FN_TYPE(ap_log_set_writer_init) *log_set_writer_init;
-    APR_OPTIONAL_FN_TYPE(ap_log_set_writer) *log_set_writer;
-
-    if (!handle_custom_log) {
-        return OK;
-    }
-
-    log_set_writer_init = APR_RETRIEVE_OPTIONAL_FN(ap_log_set_writer_init);
-    log_set_writer = APR_RETRIEVE_OPTIONAL_FN(ap_log_set_writer);
-
-    if (log_set_writer_init) {
-        log_set_writer_init(&journald_log_writer_init);
-    }
-
-    if (log_set_writer) {
-        log_set_writer(&journald_log_writer);
-    }
-
-    return OK;
-}
-
 static void journald_register_hooks(apr_pool_t *p)
 {
     static const ap_errorlog_provider journald_provider = {
@@ -246,23 +186,8 @@ static void journald_register_hooks(apr_
     ap_register_provider(p, AP_ERRORLOG_PROVIDER_GROUP, "journald",
                          AP_ERRORLOG_PROVIDER_VERSION,
                          &journald_provider);
-
-    ap_hook_open_logs(journald_open_logs, NULL, NULL, APR_HOOK_FIRST);
 }
 
-static const char *set_custom_log_on(cmd_parms *parms, void *dummy, int flag)
-{
-    handle_custom_log = flag;
-    return NULL;
-}
-
-static const command_rec journald_cmds[] =
-{
-AP_INIT_FLAG("JournaldCustomLog", set_custom_log_on, NULL, RSRC_CONF,
-     "Enable logging of CustomLog/TransferLog to journald"),
-    {NULL}
-};
-
 AP_DECLARE_MODULE(journald) =
 {
     STANDARD20_MODULE_STUFF,
@@ -270,6 +195,6 @@ AP_DECLARE_MODULE(journald) =
     NULL,
     NULL,
     NULL,
-    journald_cmds,
+    NULL,
     journald_register_hooks,
 };



Mime
View raw message