PHP: logging in request context when possible.
This commit is contained in:
@@ -1277,6 +1277,16 @@ static void
|
|||||||
nxt_php_log_message(char *message TSRMLS_DC)
|
nxt_php_log_message(char *message TSRMLS_DC)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
nxt_unit_log(nxt_php_unit_ctx, NXT_UNIT_LOG_NOTICE,
|
nxt_php_run_ctx_t *ctx;
|
||||||
"php message: %s", message);
|
|
||||||
|
ctx = SG(server_context);
|
||||||
|
|
||||||
|
if (ctx != NULL) {
|
||||||
|
nxt_unit_req_log(ctx->req, NXT_UNIT_LOG_NOTICE,
|
||||||
|
"php message: %s", message);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
nxt_unit_log(nxt_php_unit_ctx, NXT_UNIT_LOG_NOTICE,
|
||||||
|
"php message: %s", message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user