1
votes

I tried to log the cypher query generated by the spring data neo4j by using the following log4j configuration:

log4j.rootLogger=DEBUG, stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout

log4j.category.org.springframework.data.neo4j=DEBUG

However, I couldn't see there are cypher queries shown in the log. Anyone has ideas on the ways of investigating the cypher query generated for the spring neo4j data mapping?

4

4 Answers

5
votes

As of Sep-2019, I found that one of the answers in Log cypher queries was the approach needed (logging.level.org.neo4j.ogm.drivers.bolt.request.BoltRequest=DEBUG)

4
votes

they are logged using DEBUG, you can set a logger for org.springframework.data.neo4j to see them.

2
votes

Try using this :

log4j.category.org.springframework.data.neo4j=DEBUG

log4j.category.org.springframework.data.neo4j.support.query=DEBUG`

Setup a DEBUG config and then try!

2
votes

With SDN 5.0.3.RELEASE and using Bolt driver, org.neo4j.ogm.drivers.bolt.request.BoltRequest logs the queries at INFO level. Using Embedded driver, org.neo4j.ogm.drivers.embedded.request.EmbeddedRequest at DEBUG level.