GH-2841 - Introduce new logging categories from the database.

Closes #2841
This commit is contained in:
Gerrit Meier
2023-12-13 15:31:29 +01:00
parent fbb7ba183a
commit 88f6bd9dcc
3 changed files with 15 additions and 2 deletions

View File

@@ -11,3 +11,6 @@ To exclude or elevate some categories, the following loggers are in place:
* `org.springframework.data.neo4j.cypher.unsupported`
* `org.springframework.data.neo4j.cypher.deprecation`
* `org.springframework.data.neo4j.cypher.generic`
* `org.springframework.data.neo4j.cypher.security`
* `org.springframework.data.neo4j.cypher.topology`

View File

@@ -43,6 +43,8 @@ final class ResultSummaries {
private static final LogAccessor cypherUnsupportedNotificationLog = new LogAccessor(LogFactory.getLog("org.springframework.data.neo4j.cypher.unsupported"));
private static final LogAccessor cypherDeprecationNotificationLog = new LogAccessor(LogFactory.getLog("org.springframework.data.neo4j.cypher.deprecation"));
private static final LogAccessor cypherGenericNotificationLog = new LogAccessor(LogFactory.getLog("org.springframework.data.neo4j.cypher.generic"));
private static final LogAccessor cypherSecurityNotificationLog = new LogAccessor(LogFactory.getLog("org.springframework.data.neo4j.cypher.security"));
private static final LogAccessor cypherTopologyNotificationLog = new LogAccessor(LogFactory.getLog("org.springframework.data.neo4j.cypher.topology"));
/**
* Does some post-processing on the giving result summary, especially logging all notifications
@@ -98,6 +100,12 @@ final class ResultSummaries {
if (category == NotificationCategory.UNRECOGNIZED) {
return cypherUnrecognizedNotificationLog;
}
if (category == NotificationCategory.SECURITY) {
return cypherSecurityNotificationLog;
}
if (category == NotificationCategory.TOPOLOGY) {
return cypherTopologyNotificationLog;
}
return Neo4jClient.cypherLog;
}

View File

@@ -30,13 +30,15 @@
<logger name="InboundMessageDispatcher" level="info"/>
<logger name="org.springframework.data.neo4j.cypher" level="info"/>
<logger name="org.springframework.data.neo4j.cypher.performance" level="info"/>
<logger name="org.springframework.data.neo4j.cypher.hint" level="info"/>
<logger name="org.springframework.data.neo4j.cypher.performance" level="error"/>
<logger name="org.springframework.data.neo4j.cypher.hint" level="error"/>
<logger name="org.springframework.data.neo4j.cypher.unrecognized" level="error"/>
<logger name="org.springframework.data.neo4j.cypher.unsupported" level="error"/>
<!-- if deprecation gets set to "warn" or finer, all id() deprecation will get logged -->
<logger name="org.springframework.data.neo4j.cypher.deprecation" level="error"/>
<logger name="org.springframework.data.neo4j.cypher.generic" level="error"/>
<logger name="org.springframework.data.neo4j.cypher.security" level="error"/>
<logger name="org.springframework.data.neo4j.cypher.topology" level="error"/>
<logger name="org.springframework.data.neo4j" level="info"/>
<logger name="org.springframework.data.neo4j.test" level="info"/>
<logger name="org.springframework.data.neo4j.repository.query.Neo4jQuerySupport" level="debug" />