interpreter/php: use structured logging - #1644
Conversation
|
|
| log.Debugf("PHP version %x: an error occurred while determining "+ | ||
| "the VM kind (%v)", | ||
| version, err) | ||
| log.Debug("an error occurred while determining the VM kind", |
There was a problem hiding this comment.
log messages should start with capital letter (error message with small); keep also the PHP as context in the message
| log.Debug("an error occurred while determining the VM kind", | |
| log.Debug("An error occurred while determining the PHP VM kind", |
| if err != nil { | ||
| log.Debugf("PHP version %x: an error occurred while determining "+ | ||
| "the return address for execute_ex: (%v)", version, err) | ||
| log.Debug("an error occurred while determining the return address for execute_ex", |
There was a problem hiding this comment.
| log.Debug("an error occurred while determining the return address for execute_ex", | |
| log.Debug("An error occurred while determining the return address for PHP execute_ex", |
| log.Debugf("PHP version %x: an error occurred while determining "+ | ||
| "the return address for execute_ex: (%v)", version, err) | ||
| log.Debug("an error occurred while determining the return address for execute_ex", | ||
| "version", version, "error", err) |
There was a problem hiding this comment.
Since this is first of these translations, I'm raising some questions for other maintainers:
- should the
versionbe more specific, likephp_version? - should there be an additional
subsystemormoduleor similar tag to indicate it'sphprelated?
| "version", version, "error", err) | |
| "php_version", version, "error", err) |
There was a problem hiding this comment.
We should have a separate key (e.g. subsystem or module or package) for the main components and then additional keys like php_version wouldn't need the extra qualifier, so module:php, version:xyz would retain interpretability.
I think it'd be nice to have some basic guidelines for structured logging (e.g. in doc/logging-dev.md) before we start rewriting our existing logging en masse. We'd want to do that primarily for consistency which enables better UX on the consumer who'd be able to filter based on known keys.
@lucasly-ba Would you be interested in taking a crack at this?
A relevant issue is #417 which structured logging could also address by splitting the values with '/'. For example, we could have a module key with reporter, processmanager, tracer, collector and so on but logging code that requires an additional level of grouping could introduce its own nesting, e.g. going back to #417 we could have module:processmanager/pid and module:reporter/pdata.
There was a problem hiding this comment.
Yes of course ! Will do it in quite a long time but ill ping you when i dig more into this
Pull request dashboard statusWaiting on reviewers · refreshed 2026-09-10 22:26 UTC Review the latest changes. Status above doesn't look right?
|
This comment has been minimized.
This comment has been minimized.
Signed-off-by: Lucas Ly Ba <hi@lucaslyba.com>
02dd27e to
48e7264
Compare
Part of #891