logging the cypher query for spring neo4j
Asked Answered
S

6

9

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?

Scribbler answered 21/8, 2012 at 7:46 Comment(0)
D
8

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

Dislocate answered 21/8, 2012 at 10:29 Comment(2)
Thanks Michael! I added that as the new edit above, but still couldn't see the cypher queries generated by the spring data binding. What I saw from the console is the logging about the internal works of the spring, defining beans etc, but not any clues about what the underlying cypher queries looks like.Scribbler
can you share your log configuration?Dislocate
K
7

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)

Katiakatie answered 12/9, 2019 at 15:46 Comment(0)
C
3

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!

Chandos answered 29/8, 2013 at 22:19 Comment(0)
S
3

For SDN Version 7 +, try;

logging.level.org.springframework.data.neo4j=DEBUG
Slowly answered 5/5, 2023 at 11:1 Comment(0)
S
2

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.

Sapsucker answered 8/2, 2018 at 22:19 Comment(1)
org.neo4j.ogm.drivers.bolt.request.BoltRequest also delivers at DEBUGBanquet
T
0

actual example for application.yml config

logging:
  level:
    org.springframework.data.neo4j: debug
Tiercel answered 4/7 at 9:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.