MCPcopy Create free account
hub / github.com/apache/httpd / log_error_core

Function log_error_core

server/log.c:1162–1363  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1160}
1161
1162static void log_error_core(const char *file, int line, int module_index,
1163 int level,
1164 apr_status_t status, const server_rec *s,
1165 const conn_rec *c,
1166 const request_rec *r, apr_pool_t *pool,
1167 const char *fmt, va_list args)
1168{
1169 char errstr[MAX_STRING_LEN];
1170 apr_file_t *logf = NULL;
1171 int level_and_mask = level & APLOG_LEVELMASK;
1172 const request_rec *rmain = NULL;
1173 core_server_config *sconf = NULL;
1174 ap_errorlog_info info;
1175
1176 /* do we need to log once-per-req or once-per-conn info? */
1177 int log_conn_info = 0, log_req_info = 0;
1178 apr_array_header_t **lines = NULL;
1179 int done = 0;
1180 int line_number = 0;
1181
1182 if (r) {
1183 AP_DEBUG_ASSERT(r->connection != NULL);
1184 c = r->connection;
1185 }
1186
1187 if (s == NULL) {
1188 /*
1189 * If we are doing stderr logging (startup), don't log messages that are
1190 * above the default server log level unless it is a startup/shutdown
1191 * notice
1192 */
1193#ifndef DEBUG
1194 if ((level_and_mask != APLOG_NOTICE)
1195 && (level_and_mask > ap_default_loglevel)) {
1196 return;
1197 }
1198#endif
1199
1200 logf = stderr_log;
1201
1202 /* Use the main ErrorLogFormat if any */
1203 if (ap_server_conf) {
1204 sconf = ap_get_core_module_config(ap_server_conf->module_config);
1205 }
1206 }
1207 else {
1208 int configured_level = r ? ap_get_request_module_loglevel(r, module_index) :
1209 c ? ap_get_conn_server_module_loglevel(c, s, module_index) :
1210 ap_get_server_module_loglevel(s, module_index);
1211 if (s->error_log) {
1212 /*
1213 * If we are doing normal logging, don't log messages that are
1214 * above the module's log level unless it is a startup/shutdown notice
1215 */
1216 if ((level_and_mask != APLOG_NOTICE)
1217 && (level_and_mask > configured_level)) {
1218 return;
1219 }

Callers 6

log_error_va_glueFunction · 0.85
ap_log_error_Function · 0.85
ap_log_perror_Function · 0.85
ap_log_rerror_Function · 0.85
ap_log_cserror_Function · 0.85
ap_log_cerror_Function · 0.85

Calls 8

add_log_idFunction · 0.85
do_errorlog_formatFunction · 0.85
do_errorlog_defaultFunction · 0.85
write_loglineFunction · 0.85

Tested by

no test coverage detected