gogm icon indicating copy to clipboard operation
gogm copied to clipboard

log cypher query at debug level

Open jcchen2 opened this issue 3 years ago • 2 comments

Feature Request:

i'd like to log cypher queries at debug level to better understand what is going on under the hood

Context

this will help me better understand gogm and troubleshoot issues

Alternatives

dig into gogm source code

Would you be interested in implementing this feature?

Yes

jcchen2 avatar Feb 27 '22 00:02 jcchen2

Hi @jcchen2, thanks for submitting an issue (and sending us a follow up email!), it is greatly appreciated. Query logging is definitely something we should think about, and I think it is one of the features that we neglected to reimplement during the transition to v2.

The feature is partially there if you use OpenTelemetry (see https://github.com/mindstand/gogm/blob/a8ccfb6b7c558442d6727d4f2e89e969eb08ea8b/sessionv2.go#L412), but that is probably subject to change.

We welcome any PR implementing the logging if this interests you.

nikitawootten avatar Mar 03 '22 00:03 nikitawootten

pls see https://github.com/mindstand/gogm/pull/95

i did look into opentelemetry a little bit. not sure it's a good idea to require gogm users to enable opentelemetry to log cypher queries. it is easier for developers to just set the right log level and see queries. just my thoughts.

jcchen2 avatar Mar 05 '22 06:03 jcchen2