PHP: fixed incorrect time in interpreter error log messages.
Previously, the log message callback used a generic log function, that relied on the process time cache. Since there were no time update calls in the application processes, all log lines were printed with the same time, usually correlated with the process start. Now, a non-cached logging function from libunit is used.
This commit is contained in:
@@ -251,7 +251,7 @@ NXT_EXPORT nxt_app_module_t nxt_app_module = {
|
||||
static nxt_php_target_t *nxt_php_targets;
|
||||
static nxt_int_t nxt_php_last_target = -1;
|
||||
|
||||
static nxt_task_t *nxt_php_task;
|
||||
static nxt_unit_ctx_t *nxt_php_unit_ctx;
|
||||
#if defined(ZTS) && PHP_VERSION_ID < 70400
|
||||
static void ***tsrm_ls;
|
||||
#endif
|
||||
@@ -277,8 +277,6 @@ nxt_php_start(nxt_task_t *task, nxt_process_data_t *data)
|
||||
static nxt_str_t user_str = nxt_string("user");
|
||||
static nxt_str_t admin_str = nxt_string("admin");
|
||||
|
||||
nxt_php_task = task;
|
||||
|
||||
conf = data->app;
|
||||
c = &conf->u.php;
|
||||
|
||||
@@ -405,6 +403,8 @@ nxt_php_start(nxt_task_t *task, nxt_process_data_t *data)
|
||||
return NXT_ERROR;
|
||||
}
|
||||
|
||||
nxt_php_unit_ctx = unit_ctx;
|
||||
|
||||
nxt_unit_run(unit_ctx);
|
||||
|
||||
nxt_unit_done(unit_ctx);
|
||||
@@ -1277,5 +1277,6 @@ static void
|
||||
nxt_php_log_message(char *message TSRMLS_DC)
|
||||
#endif
|
||||
{
|
||||
nxt_log(nxt_php_task, NXT_LOG_NOTICE, "php message: %s", message);
|
||||
nxt_unit_log(nxt_php_unit_ctx, NXT_UNIT_LOG_NOTICE,
|
||||
"php message: %s", message);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user