Skip to content

Commit 69b7799

Browse files
authored
docs: Add documentation on enabling debug log messages for the default logger (#991)
1 parent 604ae2c commit 69b7799

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/custom_configuration/index.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ DOCKER_HOST=tcp://docker:2375
3131

3232
## Enable logging
3333

34-
In .NET logging goes usually through the test framework. Testcontainers is not aware of the project's test framework and may not forward log messages to the right stream. The default implementation forwards log messages to the `Console` (respectively `stdout` and `stderr`) and `Debug`. The output should at least pop up in the IDE running tests in the `Debug` configuration. To override the default implementation, set the `TestcontainersSettings.Logger` property to an instance of an `ILogger` implementation.
34+
In .NET logging usually goes through the test framework. Testcontainers is not aware of the project's test framework and may not forward log messages to the appropriate output stream. The default implementation forwards log messages to the `Console` (respectively `stdout` and `stderr`). The output should at least pop up in the IDE running tests in the `Debug` configuration. To override the default implementation, set the `TestcontainersSettings.Logger` property to an instance of an `ILogger` implementation before creating a Docker resource, such as a container.
3535

3636
[testcontainers.org 00:00:00.34] Connected to Docker:
3737
Host: tcp://127.0.0.1:60706/
@@ -53,5 +53,7 @@ In .NET logging goes usually through the test framework. Testcontainers is not a
5353
[testcontainers.org 00:00:06.26] Start Docker container 027af397344d08d5fc174bf5b5d449f6b352a8a506306d3d96390aaa2bb0445d
5454
[testcontainers.org 00:00:06.64] Delete Docker container 027af397344d08d5fc174bf5b5d449f6b352a8a506306d3d96390aaa2bb0445d
5555

56+
To enable debug log messages in the default implementation, set the property `ConsoleLogger.Instance.DebugLogLevelEnabled` to `true`. This will forward messages related to building or pulling Docker images to the output stream.
57+
5658
[properties-file-format]: https://en.wikipedia.org/wiki/.properties
5759
[use-statically-defined-credentials]: https://docs.gitlab.com/ee/ci/docker/using_docker_images.html#use-statically-defined-credentials

0 commit comments

Comments
 (0)