This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git


The following commit(s) were added to refs/heads/master by this push:
     new a5f4cb0b90 Improve documentation for activating debug mode for tests 
(#2608)
a5f4cb0b90 is described below

commit a5f4cb0b9035f9a2a29188190ada7798a66a447c
Author: Houssem Nasri <houssemnasri2...@gmail.com>
AuthorDate: Mon Feb 3 09:03:42 2025 +0100

    Improve documentation for activating debug mode for tests (#2608)
---
 docs/modules/development/pages/logging.adoc      | 18 +++++++++++++++++-
 testing/base/src/main/resources/logback-test.xml |  4 +++-
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/docs/modules/development/pages/logging.adoc 
b/docs/modules/development/pages/logging.adoc
index c6c3353150..4318456743 100644
--- a/docs/modules/development/pages/logging.adoc
+++ b/docs/modules/development/pages/logging.adoc
@@ -40,4 +40,20 @@ This helps when we build a logger from a class name, and we 
use package structur
 The most useful loggers should to be documented below.
 Please maintain this list of loggers.
 
-org.apache.james.CONFIGURATION:: It is used to log events related to 
configuration loading and updating.
\ No newline at end of file
+org.apache.james.CONFIGURATION:: It is used to log events related to 
configuration loading and updating.
+
+== Logging when debugging tests
+
+When investigating failing tests, increasing the log level can provide 
valuable insights.
+
+=== Log Configuration
+
+All modules in James inherit their default test log configurations from the 
`testing-base` module.
+The log settings are defined in 
link:https://github.com/apache/james-project/blob/master/testing/base/src/main/resources/logback-test.xml[resources/logback-test.xml].
+
+=== Activating Debug Logs
+
+To enable debug logs, refer to the instructions in the header of 
`link:https://github.com/apache/james-project/blob/master/testing/base/src/main/resources/logback-test.xml[resources/logback-test.xml]`.
+Carefully follow the steps mentioned to adjust the log level appropriately.
+
+
diff --git a/testing/base/src/main/resources/logback-test.xml 
b/testing/base/src/main/resources/logback-test.xml
index b1d9aa85e8..b04afed0ea 100644
--- a/testing/base/src/main/resources/logback-test.xml
+++ b/testing/base/src/main/resources/logback-test.xml
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
+<!-- NOTE: To activate debug mode, follow Steps 1 & 2 -->
 <configuration>
         <appender name="FILE" class="ch.qos.logback.core.FileAppender">
                 <file>target/test-run.log</file>
@@ -18,12 +19,13 @@
                         <pattern>%d{HH:mm:ss.SSS} [%-5level] %logger{15} - 
%msg%n%rEx</pattern>
                 </encoder>
                 <immediateFlush>false</immediateFlush>
-                <!-- Disable below block for debug logs mode-->
+                <!-- Step 1: Disable below block for debug logs mode-->
                 <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
                         <level>ERROR</level>
                 </filter>
         </appender>
 
+        <!-- Step 2: Set log level to DEBUG-->
         <root level="WARN">
                 <appender-ref ref="CONSOLE" />
                 <appender-ref ref="FILE" />


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org
For additional commands, e-mail: notifications-h...@james.apache.org

Reply via email to