jadell / neo4jphp

PHP wrapper of the Neo4j REST interface
Other
532 stars 137 forks source link

add the ability to log commands and queries #148

Open bazo opened 10 years ago

bazo commented 10 years ago

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 commented 10 years ago

any thoughts on this?

jadell commented 10 years ago

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.

bazo commented 10 years ago

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?

jadell commented 10 years ago

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.

bazo commented 10 years ago

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

jadell commented 10 years ago

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