ramanathan1504 commented on code in PR #4411:
URL: https://github.com/apache/logging-log4j2/pull/4411#discussion_r4489501943


##########
log4j-core/src/main/java/org/apache/logging/log4j/core/appender/nosql/AbstractNoSqlConnection.java:
##########
@@ -30,6 +34,33 @@ public abstract class AbstractNoSqlConnection<W, T extends 
NoSqlObject<W>> imple
 
     private final AtomicBoolean closed = new AtomicBoolean();
 
+    /**
+     * Loads a reserved-field regular expression from a resource relative to 
the provider class.
+     *
+     * @param owner the provider class.
+     * @param resourceName the resource name.
+     * @return the compiled pattern for full-string matching.
+     * @throws IllegalStateException if the resource or pattern is missing or 
invalid.
+     * @since 2.27.0
+     */
+    protected static Pattern loadReservedFieldPattern(final Class<?> owner, 
final String resourceName) {

Review Comment:
   This adds a `protected static` method to log4j-core API for patterns users 
cannot change. Can `CouchDbConnection` use `fieldName.startsWith("_")` and 
`MongoDb4Connection` use `"_id".equals(fieldName)`? Then this method, both 
`reserved-fields.properties` files and `AbstractNoSqlConnectionTest` can go.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to