diff --git a/persistence-modules/pom.xml b/persistence-modules/pom.xml
index 988bb46575..7be71ad215 100644
--- a/persistence-modules/pom.xml
+++ b/persistence-modules/pom.xml
@@ -60,6 +60,7 @@
spring-boot-persistence
spring-boot-persistence-h2
spring-boot-persistence-mongodb
+ spring-boot-persistence-mongodb-2
spring-data-arangodb
spring-data-cassandra
spring-data-cassandra-test
diff --git a/persistence-modules/spring-boot-persistence-mongodb-2/.gitignore b/persistence-modules/spring-boot-persistence-mongodb-2/.gitignore
new file mode 100644
index 0000000000..2d513a0101
--- /dev/null
+++ b/persistence-modules/spring-boot-persistence-mongodb-2/.gitignore
@@ -0,0 +1,2 @@
+/.idea/
+/target/
diff --git a/persistence-modules/spring-boot-persistence-mongodb-2/README.md b/persistence-modules/spring-boot-persistence-mongodb-2/README.md
new file mode 100644
index 0000000000..9169e09813
--- /dev/null
+++ b/persistence-modules/spring-boot-persistence-mongodb-2/README.md
@@ -0,0 +1,4 @@
+# Relevant Articles
+
+- [Logging MongoDB Queries with Spring Boot](https://www.baeldung.com/spring-boot-mongodb-logging)
+- More articles: [[<--prev]](../spring-boot-persistence-mongodb)
\ No newline at end of file
diff --git a/persistence-modules/spring-boot-persistence-mongodb-2/pom.xml b/persistence-modules/spring-boot-persistence-mongodb-2/pom.xml
new file mode 100644
index 0000000000..a6ac4987a1
--- /dev/null
+++ b/persistence-modules/spring-boot-persistence-mongodb-2/pom.xml
@@ -0,0 +1,35 @@
+
+
+ 4.0.0
+ spring-boot-persistence-mongodb-2
+ spring-boot-persistence-mongodb-2
+ war
+ This is simple boot application for Spring boot persistence mongodb test
+
+
+ com.baeldung
+ parent-boot-2
+ 0.0.1-SNAPSHOT
+ ../../parent-boot-2
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-data-mongodb
+
+
+ de.flapdoodle.embed
+ de.flapdoodle.embed.mongo
+ ${embed.mongo.version}
+ test
+
+
+
+
+ 3.2.6
+
+
+
diff --git a/persistence-modules/spring-boot-persistence-mongodb-2/src/main/java/com/baeldung/SpringBootPersistenceApplication.java b/persistence-modules/spring-boot-persistence-mongodb-2/src/main/java/com/baeldung/SpringBootPersistenceApplication.java
new file mode 100644
index 0000000000..2dff3f37df
--- /dev/null
+++ b/persistence-modules/spring-boot-persistence-mongodb-2/src/main/java/com/baeldung/SpringBootPersistenceApplication.java
@@ -0,0 +1,13 @@
+package com.baeldung;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class SpringBootPersistenceApplication {
+
+ public static void main(String ... args) {
+ SpringApplication.run(SpringBootPersistenceApplication.class, args);
+ }
+
+}
diff --git a/persistence-modules/spring-boot-persistence-mongodb/src/main/java/com/baeldung/logging/model/Book.java b/persistence-modules/spring-boot-persistence-mongodb-2/src/main/java/com/baeldung/logging/model/Book.java
similarity index 100%
rename from persistence-modules/spring-boot-persistence-mongodb/src/main/java/com/baeldung/logging/model/Book.java
rename to persistence-modules/spring-boot-persistence-mongodb-2/src/main/java/com/baeldung/logging/model/Book.java
diff --git a/persistence-modules/spring-boot-persistence-mongodb-2/src/main/resources/application.properties b/persistence-modules/spring-boot-persistence-mongodb-2/src/main/resources/application.properties
new file mode 100644
index 0000000000..9dbc261896
--- /dev/null
+++ b/persistence-modules/spring-boot-persistence-mongodb-2/src/main/resources/application.properties
@@ -0,0 +1 @@
+spring.application.name=spring-boot-persistence-mongodb-2
diff --git a/persistence-modules/spring-boot-persistence-mongodb/src/test/java/com/baeldung/logging/GroupByAuthor.java b/persistence-modules/spring-boot-persistence-mongodb-2/src/test/java/com/baeldung/logging/GroupByAuthor.java
similarity index 100%
rename from persistence-modules/spring-boot-persistence-mongodb/src/test/java/com/baeldung/logging/GroupByAuthor.java
rename to persistence-modules/spring-boot-persistence-mongodb-2/src/test/java/com/baeldung/logging/GroupByAuthor.java
diff --git a/persistence-modules/spring-boot-persistence-mongodb/src/test/java/com/baeldung/logging/LoggingUnitTest.java b/persistence-modules/spring-boot-persistence-mongodb-2/src/test/java/com/baeldung/logging/LoggingUnitTest.java
similarity index 97%
rename from persistence-modules/spring-boot-persistence-mongodb/src/test/java/com/baeldung/logging/LoggingUnitTest.java
rename to persistence-modules/spring-boot-persistence-mongodb-2/src/test/java/com/baeldung/logging/LoggingUnitTest.java
index 1c59dcb5ac..00def53566 100644
--- a/persistence-modules/spring-boot-persistence-mongodb/src/test/java/com/baeldung/logging/LoggingUnitTest.java
+++ b/persistence-modules/spring-boot-persistence-mongodb-2/src/test/java/com/baeldung/logging/LoggingUnitTest.java
@@ -35,7 +35,7 @@ import de.flapdoodle.embed.mongo.distribution.Version;
import de.flapdoodle.embed.process.runtime.Network;
@SpringBootTest
-@TestPropertySource(properties = { "logging.level.org.springframework.data.mongodb.core.MongoTemplate=DEBUG" })
+@TestPropertySource(properties = { "logging.level.org.springframework.data.mongodb.core.MongoTemplate=INFO" })
public class LoggingUnitTest {
private static final String CONNECTION_STRING = "mongodb://%s:%d";
@@ -51,7 +51,7 @@ public class LoggingUnitTest {
@BeforeEach
void setup() throws Exception {
String ip = "localhost";
- int port = SocketUtils.findAvailableTcpPort();
+ int port = Network.freeServerPort(Network.getLocalHost());
ImmutableMongodConfig mongodConfig = MongodConfig.builder()
.version(Version.Main.PRODUCTION)
diff --git a/persistence-modules/spring-boot-persistence-mongodb-2/src/test/resources/application.properties b/persistence-modules/spring-boot-persistence-mongodb-2/src/test/resources/application.properties
new file mode 100644
index 0000000000..a5b5fb9804
--- /dev/null
+++ b/persistence-modules/spring-boot-persistence-mongodb-2/src/test/resources/application.properties
@@ -0,0 +1 @@
+spring.mongodb.embedded.version=4.4.9
\ No newline at end of file
diff --git a/persistence-modules/spring-boot-persistence-mongodb-2/src/test/resources/logback-test.xml b/persistence-modules/spring-boot-persistence-mongodb-2/src/test/resources/logback-test.xml
new file mode 100644
index 0000000000..8d4771e308
--- /dev/null
+++ b/persistence-modules/spring-boot-persistence-mongodb-2/src/test/resources/logback-test.xml
@@ -0,0 +1,12 @@
+
+
+
+
+ [%d{ISO8601}]-[%thread] %-5level %logger - %msg%n
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/persistence-modules/spring-boot-persistence-mongodb/README.md b/persistence-modules/spring-boot-persistence-mongodb/README.md
index 91dd8718e1..8e9399f076 100644
--- a/persistence-modules/spring-boot-persistence-mongodb/README.md
+++ b/persistence-modules/spring-boot-persistence-mongodb/README.md
@@ -7,4 +7,4 @@
- [ZonedDateTime with Spring Data MongoDB](https://www.baeldung.com/spring-data-mongodb-zoneddatetime)
- [A Guide to @DBRef in MongoDB](https://www.baeldung.com/spring-mongodb-dbref-annotation)
- [Import Data to MongoDB From JSON File Using Java](https://www.baeldung.com/java-import-json-mongodb)
-- [Logging MongoDB Queries with Spring Boot](https://www.baeldung.com/spring-boot-mongodb-logging)
+- More articles: [[next-->]](../spring-boot-persistence-mongodb-2)