Skip to content

Commit 2f5921a

Browse files
committed
GH-2841 - Introduce new logging categories from the database.
Closes #2841
1 parent b420d34 commit 2f5921a

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

src/main/antora/modules/ROOT/pages/appendix/logging.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ To exclude or elevate some categories, the following loggers are in place:
1010
* `org.springframework.data.neo4j.cypher.unrecognized`
1111
* `org.springframework.data.neo4j.cypher.unsupported`
1212
* `org.springframework.data.neo4j.cypher.deprecation`
13-
* `org.springframework.data.neo4j.cypher.generic`
13+
* `org.springframework.data.neo4j.cypher.generic`
14+
* `org.springframework.data.neo4j.cypher.security`
15+
* `org.springframework.data.neo4j.cypher.topology`

src/main/java/org/springframework/data/neo4j/core/ResultSummaries.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ final class ResultSummaries {
4343
private static final LogAccessor cypherUnsupportedNotificationLog = new LogAccessor(LogFactory.getLog("org.springframework.data.neo4j.cypher.unsupported"));
4444
private static final LogAccessor cypherDeprecationNotificationLog = new LogAccessor(LogFactory.getLog("org.springframework.data.neo4j.cypher.deprecation"));
4545
private static final LogAccessor cypherGenericNotificationLog = new LogAccessor(LogFactory.getLog("org.springframework.data.neo4j.cypher.generic"));
46+
private static final LogAccessor cypherSecurityNotificationLog = new LogAccessor(LogFactory.getLog("org.springframework.data.neo4j.cypher.security"));
47+
private static final LogAccessor cypherTopologyNotificationLog = new LogAccessor(LogFactory.getLog("org.springframework.data.neo4j.cypher.topology"));
4648

4749
/**
4850
* Does some post-processing on the giving result summary, especially logging all notifications
@@ -98,6 +100,12 @@ private static LogAccessor getLogAccessor(NotificationCategory category) {
98100
if (category == NotificationCategory.UNRECOGNIZED) {
99101
return cypherUnrecognizedNotificationLog;
100102
}
103+
if (category == NotificationCategory.SECURITY) {
104+
return cypherSecurityNotificationLog;
105+
}
106+
if (category == NotificationCategory.TOPOLOGY) {
107+
return cypherTopologyNotificationLog;
108+
}
101109
return Neo4jClient.cypherLog;
102110
}
103111

src/test/resources/logback-test.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,15 @@
3030
<logger name="InboundMessageDispatcher" level="info"/>
3131

3232
<logger name="org.springframework.data.neo4j.cypher" level="info"/>
33-
<logger name="org.springframework.data.neo4j.cypher.performance" level="info"/>
34-
<logger name="org.springframework.data.neo4j.cypher.hint" level="info"/>
33+
<logger name="org.springframework.data.neo4j.cypher.performance" level="error"/>
34+
<logger name="org.springframework.data.neo4j.cypher.hint" level="error"/>
3535
<logger name="org.springframework.data.neo4j.cypher.unrecognized" level="error"/>
3636
<logger name="org.springframework.data.neo4j.cypher.unsupported" level="error"/>
3737
<!-- if deprecation gets set to "warn" or finer, all id() deprecation will get logged -->
3838
<logger name="org.springframework.data.neo4j.cypher.deprecation" level="error"/>
3939
<logger name="org.springframework.data.neo4j.cypher.generic" level="error"/>
40+
<logger name="org.springframework.data.neo4j.cypher.security" level="error"/>
41+
<logger name="org.springframework.data.neo4j.cypher.topology" level="error"/>
4042
<logger name="org.springframework.data.neo4j" level="info"/>
4143
<logger name="org.springframework.data.neo4j.test" level="info"/>
4244
<logger name="org.springframework.data.neo4j.repository.query.Neo4jQuerySupport" level="debug" />

0 commit comments

Comments
 (0)