Skip to content

Commit

Permalink
enable logging for integration testing (log4j2-spring.xml is not in the
Browse files Browse the repository at this point in the history
ignored resources)
  • Loading branch information
GordeaS authored and GordeaS committed Mar 18, 2024
1 parent 3aba94f commit 91094db
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ public abstract class BaseUserSetTestUtils {

static {
// MONGO_CONTAINER = new MongoDBContainer("mongo:6.0.14-jammy")
MONGO_CONTAINER = new MongoContainer("set-api-test")
final String serviceDB = "admin"; // to change to "set-api-test"
MONGO_CONTAINER = new MongoContainer(serviceDB)
.withLogConsumer(new WaitingConsumer()
.andThen(new ToStringConsumer()));

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d{yyyy-MM-dd'T'HH:mm:ss.SSSXXX} %-5p %C:%L [%t] - %m%n"/>
<!--
<PatternLayout>
<alwaysWriteExceptions>false</alwaysWriteExceptions>
<pattern>{&quot;@timestamp&quot;:&quot;%d{yyyy-MM-dd'T'HH:mm:ss.SSSXXX}&quot;,&quot;level&quot;:&quot;%-5p&quot;,&quot;thread&quot;:&quot;%t&quot;,&quot;class&quot;:&quot;%C&quot;, &quot;code_line_number&quot;:&quot;%L&quot;,&quot;message&quot;:&quot;%replace{%m %throwable}{[\n\t"]}{ }&quot;}%n</pattern>
</PatternLayout>
-->
</Console>
</Appenders>
<Loggers>
<Root level="INFO">
<AppenderRef ref="Console"/>
</Root>
<logger name="eu.europeana.set" level="DEBUG">
</logger>

<logger name="eu.europeana" level="INFO">
</logger>
<logger name="org.mongodb.driver" level="DEBUG">
</logger>
<logger name="com.mongodb.diagnostics" level="WARN">
</logger>
<!-- To enable logging of Mongo queries, set log level to debug -->
<logger name="org.mongodb.morphia" level="DEBUG"/>

<!-- To enable logging of test contaners, set log level to debug -->
<logger name="org.testcontainers" level="DEBUG"/>

</Loggers>
</Configuration>

0 comments on commit 91094db

Please sign in to comment.