ppkarwasz commented on code in PR #3322:
URL: https://github.com/apache/logging-log4j2/pull/3322#discussion_r1955771320


##########
src/site/antora/modules/ROOT/examples/manual/appenders/database/nosql-mongo-keys.json:
##########


Review Comment:
   I disagree: the [official connection 
string](https://www.mongodb.com/docs/manual/reference/connection-string/) does 
not contain any segment that could be **unambiguously** interpreted as 
`databaseName` or `collectionName`. Using three configuration properties is 
more verbose, but it is easier to understand and less Log4j-specific (or 
Java-specific). When I tested the MongoDB appender for the first time, it 
wasn't at all obvious to me that `defaultauthdb` is also the database name, 
where data will go. I had also no idea, where to put the collection name.
   
   Providing examples without `databaseName` and `collectionName` is a little 
bit like providing JDBC examples without `user` and `password`, since Postgres 
allows you to add them to the connection string: 
`jdbc:postgresql://localhost/test?user=fred&password=secret&ssl=true`. It's not 
wrong, but it feels unnatural



-- 
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

Reply via email to