I am getting unwanted query log from spring neo4j like following
25-08-2018 23:47:07.597 [restartedMain] INFO o.n.o.d.bolt.request.BoltRequest.executeRequest -
Request: MATCH (n:`OntoCategory`) WHERE n.`name` = { `name_0` } WITH n RETURN n,[ [ (n)-[r_h1:`HasSynonym`]->(o1:`OntoSynonyms`) | [ r_h1, o1 ] ] ], ID(n) with params {name_0=Breakfast Items}
25-08-2018 23:47:07.610 [restartedMain] INFO o.n.o.d.bolt.request.BoltRequest.executeRequest -
I am using following logging properties in my application.properties
Is there anything I've missed to add. I'm using spring boot version 2.0.3
logging.level.root=info
logging.path=path
logging.file=${logging.path}/log.log
logging.pattern.file=%d{dd-MM-yyyy HH:mm:ss.SSS} [%thread] %-5level %logger{36}.%M - %msg%n
logging.pattern.console=%d{dd-MM-yyyy HH:mm:ss.SSS} [%thread] %-5level %logger{36}.%M - %n%highlight%msg%n
Following two log properties are added from following post which doesn't change anything
log4j.category.org.springframework.data.neo4j=DEBUG
log4j.category.org.springframework.data.neo4j.support.query=DEBUG`
The logging of the cypher query is done by BoltRequest
class in neo4j-ogm. So that's where you should be changing the logging level like the following (to keep other logging configuration unaffected):
logging.level.org.neo4j.ogm.drivers.bolt.request.BoltRequest=WARN
Note, however that, as the logging level in this class has been changed very recently according to your request (per #530, by commit f37a78e - logging level of cypher queries downgraded to DEBUG), if you upgrade your SDN installation in your project, you may just be automatically getting rid of the query logs w/o making this adjustment to logging configuration
(I currently have neo4g-ogm-bolt-driver-3.1.4.jar
in my project, and I don't get the queries logged).
log4j.category.org.springframework.data.neo4j.support.query=DEBUG
This entry in the log configuration, logs the query. To avoid logging query to the log files remove this entry.
Since you have this configuration :
logging.level.root=info
The root log level will be info, but if another level is different, it will override it for this log.
So, to have the following behaviour :
What you want is to do this :
logging.level.root=info
log4j.category.org.springframework.data.neo4j=WARN
log4j.category.org.springframework.data.neo4j.support.query=WARN
By adding this line in application.properties queries is not logging in console.Its working
logging.level.org.neo4j.ogm.drivers=OFF
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