Support a wildcard in backtrace_functions
| От | Jelte Fennema-Nio |
|---|---|
| Тема | Support a wildcard in backtrace_functions |
| Дата | |
| Msg-id | CAGECzQTpdujCEt2SH4DBwRLoDq4HJArGDaxJSsWX0G=tNnzaVA@mail.gmail.com обсуждение исходный текст |
| Ответы |
Re: Support a wildcard in backtrace_functions
|
| Список | pgsql-hackers |
I would like to be able to add backtraces to all ERROR logs. This is useful to me, because during postgres or extension development any error that I hit is usually unexpected. This avoids me from having to change backtrace_functions every time I get an error based on the function name listed in the LOCATION output (added by "\set VERBOSITY verbose"). Attached is a trivial patch that starts supporting backtrace_functions='*'. By setting that in postgresql.conf for my dev environment it starts logging backtraces always. The main problem it currently has is that it adds backtraces to all LOG level logs too. So probably we want to make backtrace_functions only log backtraces for ERROR and up (or maybe WARNING/NOTICE and up), or add a backtrace_functions_level GUC too control this behaviour. The docs of backtrace_functions currently heavily suggest that it should only be logging backtraces for errors, so either we actually start doing that or we should clarify the docs (emphasis mine): > This parameter contains a comma-separated list of C function > names. If an **error** is raised and the name of the internal C function > where the **error** happens matches a value in the list, then a > backtrace is written to the server log together with the error > message. This can be used to debug specific areas of the > source code.
Вложения
В списке pgsql-hackers по дате отправления: