neo4j / neo4j-go-driver

Neo4j Bolt Driver for Go
Apache License 2.0
485 stars 68 forks source link

[Feature Request - 6.0] Pass context to logging functions #528

Open adrianiacobghiula opened 11 months ago

adrianiacobghiula commented 11 months ago

Hi,

In the ideea of having a consistent trace of a request in the logs is it possible to have the context as first parameter in the logging functions ( https://github.com/neo4j/neo4j-go-driver/blob/5.0/neo4j/log/logger.go#L46-L49 ) .I believe one could, then, add a "requestID" in the context and expect to have this parameter in a custom implementation of the logger to print it

Thank you

robsdedude commented 8 months ago

Thanks for the suggestion.

This certainly cannot happen before 6.0 as it constitutes a breaking change.

Generally, I think this change provides value :+1: