# [PATCH] fpm/feature: show function and line in error_log only on debug

- Thread: https://externals.io/message/46405
- Original archive: https://news-web.php.net/php.internals/46405
- Started by jerome@loyet.net on 2009-12-13T16:39:10+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #46405 — jerome@loyet.net — 2009-12-13T16:39:10+00:00

URL: https://externals.io/message/46405#46405

Hi tony,

in the FPM error_log, the function and the line, from which the log
function is called, are written to the error_log as show above:

Dec 13 17:30:18.81042 [NOTICE] fpm_event_init_main(), line 87:
libevent: using epoll

It's debug information and it's not relevant but for developers. The
attached patch change this behaviour showing function and line only
when the log_level is set to debug.

Moreover, it adds the PID of the process which call the log function
but only in with a debug loglevel.

Without debug:
Dec 13 17:32:59.383706 [NOTICE] libevent: using epoll

With debug:
Dec 13 17:33:38.817841 [NOTICE] pid 7932, fpm_event_init_main(), line
87: libevent: using epoll

Hope it helps
++ Jerome

---

## #46407 — jerome@loyet.net — 2009-12-13T17:20:10+00:00

URL: https://externals.io/message/46405#46407 · In reply to: #46405

Le 13 décembre 2009 17:39, Jérôme Loyet <jerome@loyet.net> a écrit :
> Hi tony,
>
> in the FPM error_log, the function and the line, from which the log
> function is called, are written to the error_log as show above:
>
> Dec 13 17:30:18.81042 [NOTICE] fpm_event_init_main(), line 87:
> libevent: using epoll
>
> It's debug information and it's not relevant but for developers. The
> attached patch change this behaviour showing function and line only
> when the log_level is set to debug.
>
> Moreover, it adds the PID of the process which call the log function
> but only in with a debug loglevel.
>
> Without debug:
> Dec 13 17:32:59.383706 [NOTICE] libevent: using epoll
>
> With debug:
> Dec 13 17:33:38.817841 [NOTICE] pid 7932, fpm_event_init_main(), line
> 87: libevent: using epoll

With the correct version of the patch (.txt extension).

>
> Hope it helps
> ++ Jerome
