Skip to content

Commit

Permalink
- Fixed bug #32587 (Apache2: errors sent to error_log do not include …
Browse files Browse the repository at this point in the history
…timestamps)
  • Loading branch information
foobar committed Apr 8, 2005
1 parent 5313e98 commit 7af1dfa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
17 changes: 5 additions & 12 deletions sapi/apache2filter/sapi_apache2.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,18 +272,11 @@ static void php_apache_sapi_log_message(char *msg)

ctx = SG(server_context);

/* We use APLOG_STARTUP because it keeps us from printing the
* data and time information at the beginning of the error log
* line. Not sure if this is correct, but it mirrors what happens
* with Apache 1.3 -- rbb
*/
if (ctx == NULL) { /* we haven't initialized our ctx yet, oh well */
ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO | APLOG_STARTUP,
0, NULL, "%s", msg);
ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_STARTUP, 0, NULL, "%s", msg);
}
else {
ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO | APLOG_STARTUP,
0, ctx->r->server, "%s", msg);
ap_log_error(APLOG_MARK, APLOG_ERR, 0, ctx->r->server, "%s", msg);
}
}

Expand Down Expand Up @@ -363,7 +356,7 @@ static int php_input_filter(ap_filter_t *f, apr_bucket_brigade *bb,

ctx = SG(server_context);
if (ctx == NULL) {
ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, f->r,
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, f->r,
"php failed to get server context");
return HTTP_INTERNAL_SERVER_ERROR;
}
Expand Down Expand Up @@ -475,7 +468,7 @@ static int php_output_filter(ap_filter_t *f, apr_bucket_brigade *bb)

ctx = SG(server_context);
if (ctx == NULL) {
ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, f->r,
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, f->r,
"php failed to get server context");
zend_try {
zend_ini_deactivate(TSRMLS_C);
Expand Down Expand Up @@ -644,7 +637,7 @@ static void php_add_filter(request_rec *r, ap_filter_t *f)
/* for those who still have Set*Filter PHP configured */
while (f) {
if (strcmp(f->frec->name, "PHP") == 0) {
ap_log_error(APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO,
ap_log_error(APLOG_MARK, APLOG_WARNING,
0, r->server,
"\"Set%sFilter PHP\" already configured for %s",
output ? "Output" : "Input", r->uri);
Expand Down
9 changes: 2 additions & 7 deletions sapi/apache2handler/sapi_apache2.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,22 +264,17 @@ static void php_apache_sapi_log_message(char *msg)

ctx = SG(server_context);

/* We use APLOG_STARTUP because it keeps us from printing the
* data and time information at the beginning of the error log
* line. Not sure if this is correct, but it mirrors what happens
* with Apache 1.3 -- rbb
*/
if (ctx == NULL) { /* we haven't initialized our ctx yet, oh well */
ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_STARTUP, 0, NULL, "%s", msg);
} else {
ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_STARTUP, 0, ctx->r, "%s", msg);
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, ctx->r, "%s", msg);
}
}

static void php_apache_sapi_log_message_ex(char *msg, request_rec *r)
{
if (r) {
ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_STARTUP, 0, r, msg, r->filename);
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, msg, r->filename);
} else {
php_apache_sapi_log_message(msg);
}
Expand Down

0 comments on commit 7af1dfa

Please sign in to comment.