gogm
gogm copied to clipboard
log query
Committer Notes
log cypher query and parameters at debug level
Checklist
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have included new tests that address the changes
Hello @jcchen2, thanks for your contributions! I think this is looking good! However I do have a few comments:
- if possible I think query logging and ESPECIALLY parameter logging should be toggleable via a setting in the gogm config (that should probably default to off). Parameter logging can lead to nasty vulnerabilities if someone gets access to your logs.
- instead of logging the cypher parameters at each point, injecting that functionality into a session's
runReadOnly
andrunWrite
methods would be a bit more elegant and future proof. @erictg any ideas on how to extract the cypher parameters from therunWrite
method?
@nikitawootten i created logging wrappers around neo4j's session and transaction. it should be future-proof. i also updated logging to conditionally log parameters. pls let me know what you think.