Log cypher queries

余生长醉 提交于 2019-12-23 05:01:17

问题


Is there a way to log cypher queries that get generated when we use spring jpa inbuilt queries like findById!? I have a complex inbuilt query whose cypher I need to see


回答1:


Neo4j provides the ability to log all executed queries.

Per https://neo4j.com/docs/operations-manual/current/monitoring/logging/query-logging:

Neo4j can be configured to log queries executed in the database.

Query logging must be enabled by setting the dbms.logs.query.enabled parameter to true. The parameter dbms.logs.query.threshold determines the threshold for logging a query. If the execution of a query takes a longer time than this threshold, it will be logged. Setting dbms.logs.query.threshold to 0 will result in all queries being logged




回答2:


Using Spring Boot 2.1.5, I am able to log Spring Data Neo4j generated Cypher queries just by adding:

logging.level.org.neo4j.ogm.drivers.bolt.request.BoltRequest=DEBUG

to application.properties.



来源:https://stackoverflow.com/questions/56126471/log-cypher-queries

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!