vy commented on PR #3467: URL: https://github.com/apache/logging-log4j2/pull/3467#issuecomment-2665989919
You’re right, we can and should indeed improve on this. Op di 18 feb 2025 om 14:24 schreef Josh Smith ***@***.***> > ***@***.**** commented on this pull request. > ------------------------------ > > In > log4j-mongodb4/src/main/java/org/apache/logging/log4j/mongodb4/MongoDb4Provider.java > <https://github.com/apache/logging-log4j2/pull/3467#discussion_r1959741448> > : > > > + ConnectionString connectionString; > + try { > + connectionString = new ConnectionString(connectionStringSource); > + } catch (final IllegalArgumentException e) { > + LOGGER.error("Invalid MongoDB connection string `{}`.", connectionStringSource, e); > + return null; > + } > + > + String effectiveDatabaseName = databaseName != null ? databaseName : connectionString.getDatabase(); > + String effectiveCollectionName = collectionName != null ? collectionName : connectionString.getCollection(); > + // Validate the provided databaseName property > + try { > + MongoNamespace.checkDatabaseNameValidity(effectiveDatabaseName); > + } catch (final IllegalArgumentException e) { > + LOGGER.error("Invalid MongoDB database name `{}`.", effectiveDatabaseName, e); > + return null; > + } > + // Validate the provided collectionName property > + try { > + MongoNamespace.checkCollectionNameValidity(effectiveCollectionName); > + } catch (final IllegalArgumentException e) { > + LOGGER.error("Invalid MongoDB collection name `{}`.", effectiveCollectionName, e); > + return null; > + } > > For people just trying to figure out how to add functionality its really > hard when disputes about coding approach between maintainers are getting > done inside the comments for a specific PR. I would recommend that this > becomes something you document better to make this easier for others. > > — > Reply to this email directly, view it on GitHub > <https://github.com/apache/logging-log4j2/pull/3467#discussion_r1959741448>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AAARTSKCPLWIUKTK5FFEMZT2QMYBJAVCNFSM6AAAAABXF6KYPWVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDMMRTGU2TSNJZGA> > . > You are receiving this because you were assigned.Message ID: > ***@***.***> > -- 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: notifications-unsubscr...@logging.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org