Skip to content

changed some of the runtime logs to server logs#1285

Merged
DrDet merged 4 commits into
masterfrom
danil42russia/logs_refactoring
Jun 9, 2025
Merged

changed some of the runtime logs to server logs#1285
DrDet merged 4 commits into
masterfrom
danil42russia/logs_refactoring

Conversation

@Danil42Russia
Copy link
Copy Markdown
Contributor

@Danil42Russia Danil42Russia commented Apr 13, 2025

Я долго думал как лучше сделать данную задачу. Сейчас у нас есть разделение на серверные логи log_server_*, которые пишутся только с master процесса и "рантайм" логи php_*. Идеологические они между собой ни как не связаны, кроме места где они пишутся в файл.
При этом у серверных ошибок, уровень ошибок отрицательный, а у рантайм положительный. Благодаря этому, отсутствует пересечения ошибок с одинаковым типом. Можно считать, что это разные каналы для логов.

Чтобы никак не трогать текущий интерфейс php_runtime_critical, я добавил новую функцию php_runtime_critical, которая делает всё то же самое, но только пишет ошибку с серверным уровнем.

Мысли вслух
По-хорошему, не должно быть никаких разделений на серверные и рантайм логи, всё идеологически должно быть в одном месте.

@Danil42Russia Danil42Russia added refactoring Logic and code style improvements runtime Feature related to runtime labels Apr 13, 2025
@Danil42Russia Danil42Russia self-assigned this Apr 13, 2025
@Danil42Russia Danil42Russia changed the title Danil42russia/logs refactoring changed some of the runtime logs to server logs Apr 13, 2025
@Danil42Russia Danil42Russia requested a review from DrDet April 14, 2025 09:27
@Danil42Russia Danil42Russia marked this pull request as ready for review April 14, 2025 10:51
@Danil42Russia Danil42Russia added this to the next milestone Apr 14, 2025
Comment thread server/php-engine.cpp
@Danil42Russia Danil42Russia modified the milestones: 14.04.2025, next Apr 14, 2025
Copy link
Copy Markdown
Contributor

@DrDet DrDet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems, that we already have the criteria to distinguish critical 'runtime' and 'server' errors from warnigns -- it's uncaught == true

json_out_it->append_raw(uncaught ? R"json("uncaught":true)json" : R"json("uncaught":false)json");

Comment thread runtime/php_assert.cpp Outdated
Comment thread runtime/php_assert.cpp Outdated
@DrDet DrDet force-pushed the danil42russia/logs_refactoring branch from bdd66bd to c3b2a35 Compare June 6, 2025 16:30
DrDet
DrDet previously approved these changes Jun 6, 2025
@DrDet DrDet force-pushed the danil42russia/logs_refactoring branch 3 times, most recently from a08db05 to b82fcbe Compare June 6, 2025 16:41
DrDet
DrDet previously approved these changes Jun 6, 2025
@DrDet DrDet force-pushed the danil42russia/logs_refactoring branch 2 times, most recently from 8185dea to 9a78ac2 Compare June 6, 2025 17:04
@DrDet DrDet requested a review from astrophysik June 6, 2025 17:19
@DrDet DrDet force-pushed the danil42russia/logs_refactoring branch from 9a78ac2 to d1218ca Compare June 9, 2025 13:36
@DrDet DrDet merged commit 6362473 into master Jun 9, 2025
7 checks passed
@DrDet DrDet deleted the danil42russia/logs_refactoring branch June 9, 2025 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactoring Logic and code style improvements runtime Feature related to runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants