So, here is the scenario:
spring-data-neo4j
The following code is based on the example code Cineasts:
public interface CrewRepository extends GraphRepository<Crew> {
Iterable<Crew> findByNameLike(String name);
@Query("start thinker=node({0}) match thinker-[:crews]-crews return crews")
Set<Crew> findByThinker(Long thinkerId);
}
No news here. The problem is: the query findByNameLike
doesn't work whereas the findByThinker
does.
I have modified my log configuration file many times - final version is the one below - but, doesn't matter what I try, I can't see any queries being logged - either on my log file or on the server.
<logger name="org.neo4j">
<level value="DEBUG" />
<appender-ref ref="console" />
</logger>
<logger name="org.springframework.data.neo4j">
<level value="DEBUG" />
<appender-ref ref="console" />
</logger>
<root>
<priority value="error" />
<appender-ref ref="console" />
</root>
All I want is the log the queries so I can see if it's a bug on spring-data-neo4j
or if I'm missing something... I have looked through the documentation of both, code examples and couldn't find anything that specific.
Any help? Thank you!
You can enable query logging by adding the following lines to your log4j.xml:
<logger name="org.springframework.data.neo4j.support.query">
<level value="debug" />
</logger>
If anyone lands here looking for how to log queries when Neo4j Server is accessed remotely over the REST API, use
<logger name="org.springframework.data.neo4j.rest.SpringRestCypherQueryEngine">
<level value="debug" />
</logger>
If you're using Spring Data Neo4j and want to see the derived queries corresponding to your DAO methods,
<logger name="org.springframework.data.neo4j.repository.query.DerivedCypherRepositoryQuery">
<level value="debug" />
</logger>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With