-
Notifications
You must be signed in to change notification settings - Fork 1
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
context vs extras arguments #2
Comments
yeah @colinscape , @esclapes also bring up the exact same issue for the As I understand That'd be some "extra" information that would not make sense to put in a
I've tried to come up with examples but can't 🤷♂️ So yeah we should certainly drop it if that doesn't make sense |
It looks from the implementation that everything gets put together anyway: https://github.com/bufferapp/php-bufflog/blob/master/src/php-bufflog/BuffLog.php#L94-L102
From that, it doesn't look like there's any great difference - it's mainly the 'scope' of the information - I guess any parameters passed in the call will be more specific to the situation at hand (eg result of a function call), whereas the extra information would be the other stuff that might be useful for later analysis (eg, user id, trace id, span id, etc) and which would likely be shared across many of the logging calls from this service in this instance. |
done with #6 |
I think that was a good call @erickhun, just for reference, I found this in monolog docs:
It may be monolog specific, but it may be useful to keep it in mind if we consider move our convention to a monolog formatter |
yes @esclapes great find. I was reading how Monolog enrich information, and it use processors, that use by default the I'm wondering if the information we're trying to add are only users related, so only using |
Heya @erickhun !
Thanks for putting this together! I had a few thoughts on this that I wasn't sure how best to share, so thought I'd try out a GH issue! 😀
First up - all the 'logging' methods that are exposed have a
context
as well as aextras
parameter. None of the examples show use of theextras
parameter though, which seems to suggest that they are maybe from more 'internal' use. Is that right?If it is right, I think we should remove the
extras
parameter from the exposed methods, to keep things simple.Also, I see that the Datadog trace and span ids are being inserted into the
context[dd]
parameters. Since this is the parameter passed by the caller, this feels a bit odd, since there is the (small) potential for these to clash. It would make more sense from my side that the Datadog parameters get added into theextras
parameter. What do you think?I don't know how the
context
andextras
are treated differently by Monolog, so this might not be the most appropriate thing to do. However, I do think we should have a clear way for this to distinguish between the caller's parameters and the more 'built-in' parameters.The text was updated successfully, but these errors were encountered: