-
-
Notifications
You must be signed in to change notification settings - Fork 413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[💡 FEATURE REQUEST]: PSR-3 compatible logger RPC #1227
Comments
Up. |
Ok, guys, I see the demand ⚡ Will be in the |
Hey, community ❤️ About this feature, I guess it would be better to print to the
Personally, I'm leaning toward the second approach, like, do not touch PHP messages and context at all. |
The PHP What's the idea on how to combine the message and the context? Serializing in some way? Is it possible to get a few examples with the current options? |
It'll be serialized into a string on the PHP side (options?). I guess, in the RPC we can accept only 1 arg - string and let PHP decide how to combine the |
Here is a very draft And RR RPC part: /~https://github.com/roadrunner-server/psr-3-logger/blob/master/rpc.go |
OK, I see. Second option means PHPland is fully responsible of building the whole log entry string and therefore can produce funky levels like "critical" in whatever syntax they want. RR just accepts a new stderr entry as a single string and simply vomits it out, correct? I'm personally totally down with such approach. Gives complete flexibility and doesn't enforce any serialization constraints. We could always have some generic PHP LoggerInterface implementation which would produce a This kinda means a simple RPC call for writing to stderr is needed and the rest falls on to the PHP implementation. ¯\(ツ)/¯ |
Ok, I merged these two approaches. Here is the PHP client (the RR part will be in the next beta in a few days): link So, Next, the All methods receive a string. |
So in case somebody wants to wrap it into PSR3 compatible interface, it's up to them to map the available RR logger methods to PSR3 verbosity as they see fit? Sounds like a great middleground, thanks. 👍 |
Yeah, in Go, generally, we have only In this case, if you want to use the RR logger - feel free to use these methods. Otherwise - EDIT: This feature is in beta (until |
Plugin
RPC logger
I have an idea!
I have an idea, listen to me!!
It would be amazing if we can can publish to logger channels at RR side using PHP SDK via PSR-3 compatible API.
At the moment ALL the application logs can only be published to STDERR to be seen by RR, log context logs, all logs put using INFO level, all logs captured using
server
channel.References: https://www.php-fig.org/psr/psr-3/
The text was updated successfully, but these errors were encountered: