| 1160 | } |
| 1161 | |
| 1162 | static 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 | } |
no test coverage detected