summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/nxt_php_sapi.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/nxt_php_sapi.c b/src/nxt_php_sapi.c
index ab888f57..ee0976ce 100644
--- a/src/nxt_php_sapi.c
+++ b/src/nxt_php_sapi.c
@@ -1277,6 +1277,16 @@ static void
nxt_php_log_message(char *message TSRMLS_DC)
#endif
{
- nxt_unit_log(nxt_php_unit_ctx, NXT_UNIT_LOG_NOTICE,
- "php message: %s", message);
+ nxt_php_run_ctx_t *ctx;
+
+ 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);
+ }
}