neo4jphp icon indicating copy to clipboard operation
neo4jphp copied to clipboard

add the ability to log commands and queries

Open bazo opened this issue 11 years ago • 6 comments

hi, i would like to log my queries together with the execution time and results count. i can't find any place in the code i could hook into.

would it be possible to add some logging or event system?

bazo avatar Jun 15 '14 07:06 bazo

any thoughts on this?

bazo avatar Aug 29 '14 09:08 bazo

This is a good idea, and one I was planning for when I rewrite neo4jphp with a Guzzle backend (it natively supports logging like this.) I honestly haven't had a lot of time to work on neo4jphp recently, so I won't be building it any time soon. If you'd like to take a shot at it and send a pull request, I'll review it.

jadell avatar Aug 29 '14 12:08 jadell

guzzle logs requests, i was thinking more about logging cypher queries to display in a debug panel. what i had in mind was adding some kind of event dispatcher.

i don't know if i can pull off a rewrite of whole neo4jphp to use guzzle :) do you want to make it the only transport or add it as a new one?

bazo avatar Aug 30 '14 10:08 bazo

Sorry, I wasn't saying you should rewrite all of neo4jphp. I was suggesting that you figure out how to hook an event system into the existing code to get what you want.

jadell avatar Aug 30 '14 16:08 jadell

ok :) we got two options: use symphony event dispatcher or doctrine event manager. which one do you prefer?

bazo avatar Aug 30 '14 16:08 bazo

I prefer https://github.com/igorw/evenement I has no external dependencies, and is simple and easy to work with.

jadell avatar Aug 30 '14 16:08 jadell