Skip to content

context vs extras arguments #2

@colinscape

Description

@colinscape

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 a extras parameter. None of the examples show use of the extras 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 the extras parameter. What do you think?

I don't know how the context and extras 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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions