/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#include <stdint.h>
#include <ap_config.h>
#include "ap_mpm.h"
#include "ap_provider.h"
#include <http_core.h>
#include <httpd.h>
#include <http_log.h>
#include <apr_version.h>
#include <apr_pools.h>
#include <apr_strings.h>
#include "unixd.h"
#include "scoreboard.h"
#include "mpm_common.h"
#include "mod_log_config.h"
#include "systemd/sd-journal.h"
#include <unistd.h>
#endif
static int handle_custom_log = 0;
{
switch(level) {
/* We don't use EMERG here, because journald broadcasts EMERG messages
* to all terminals. APLOG_EMERG is usually not used in this context.
* in httpd code. */
case APLOG_EMERG: return LOG_ALERT;
case APLOG_ALERT: return LOG_ALERT;
case APLOG_CRIT: return LOG_CRIT;
case APLOG_WARNING: return LOG_WARNING;
case APLOG_NOTICE: return LOG_NOTICE;
case APLOG_INFO: return LOG_INFO;
case APLOG_DEBUG: return LOG_DEBUG;
case -1: return LOG_INFO;
default: return LOG_DEBUG;
}
return LOG_INFO;
}
{
return 0;
}
{
return APR_ENOMEM;
}
if (len < 0) {
}
else {
}
return APR_SUCCESS;
}
const server_rec *s, const request_rec *r)
{
int iov_size = 0;
/* We were not able to create subpool, log at least what we have. */
"PRIORITY=%i", priority,
NULL);
return;
}
/* Adds new entry to iovec if previous additions were successful. */
if (rv == APR_SUCCESS) \
iov_size++; \
}
if (s) {
}
if (r) {
}
}
{
return success;
}
{
const server_rec *s = info->s;
const request_rec *r = info->r;
s->error_fname : "error_log";
if (!pool) {
/* We don't have any pool, so at least log the message without
* any additional data. */
NULL);
return APR_SUCCESS;
}
return APR_SUCCESS;
}
{
return NULL;
}
void *handle,
const char **strs,
int *strl,
int nelts,
{
char *str;
char *s;
int i;
/* Last string is always \n, so skipt it */
s += strl[i];
}
return rv;
}
const char* name)
{
return log_name;
}
{
if (!handle_custom_log) {
return OK;
}
if (log_set_writer_init) {
}
if (log_set_writer) {
}
return OK;
}
{
0
};
}
{
return NULL;
}
{
"Enable logging of CustomLog/TransferLog to journald"),
{NULL}
};
{
NULL,
NULL,
NULL,
NULL,
};