Skip to content

Commit 515be40

Browse files
committed
Added documentation for capturing logs generated by different threads
1 parent be39442 commit 515be40

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ libraryDependencies += "io.github.hakky54" % "logcaptor" % "2.12.1" % Test
6161
- [Capture Managed Diagnostic Context (MDC)](#capture-managed-diagnostic-context-mdc)
6262
- [Disable any logs for specific class](#disable-any-logs-for-a-specific-class)
6363
- [Disable console output](#disable-console-output)
64+
- [Capturing logs across different threads](#capturing-logs-across-different-threads)
6465
- [Returnable values from LogCaptor](#returnable-values-from-logcaptor)
6566
3. [Known issues](#known-issues)
6667
- [Using Log Captor alongside with other logging libraries](#using-log-captor-alongside-with-other-logging-libraries)
@@ -420,6 +421,9 @@ Add `logback-test.xml` to your test resources with the following content:
420421
</configuration>
421422
```
422423

424+
##### Capturing logs across different threads
425+
LogCaptor is able to capture logs which are being logged from different threads. The main requirement to correctly capture those logs is to make sure the LogCaptor instance is created within the test method, so basically as a local variable and not as a instance or static variable.
426+
423427
##### Returnable values from LogCaptor
424428
```java
425429
import nl.altindag.log.LogCaptor;

0 commit comments

Comments
 (0)