如何禁用Spring数据neo4j的登录 [英] how to disable log in spring data neo4j
问题描述
我从spring neo4j那里获取了不必要的查询日志,如下所示:
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 -
我在我的application.properties中使用以下日志记录属性
I am using following logging properties in my application.properties
有什么我想补充的内容吗?我使用的是Spring Boot 2.0.3版
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`
推荐答案
密码查询的日志记录由neo4j-ogm中的BoltRequest
类完成.因此,您应该在此处更改日志记录级别,如下所示(以使其他日志记录配置不受影响):
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
但是请注意,由于最近根据您的请求更改了该类中的日志记录级别(每个#530 ,通过提交
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
(我目前在项目中有neo4g-ogm-bolt-driver-3.1.4.jar
,但没有记录查询).
(I currently have neo4g-ogm-bolt-driver-3.1.4.jar
in my project, and I don't get the queries logged).
这篇关于如何禁用Spring数据neo4j的登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!