mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 22:30:41 +01:00
Incorrectly encoded logger output #570
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @cezarypiatekGC on GitHub (Jan 30, 2024).
Describe the bug
The Wiremock console logger does not encode newline characters in the output. This causes problems with the log shipping mechanisms.
Expected behaviour:
I am using the WireMock.Net docker image to test my services within the K8s cluster. Because the output is formatted incorrectly, the log shipping mechanism treats each line as a separate log entry, resulting in a huge amount of log entries that are completely corrupted.
Below is the output from the Rancher console. As you can see, each line of formatted json is treated as a separate log entry:

@StefH commented on GitHub (Jan 30, 2024):
https://github.com/WireMock-Net/WireMock.Net/pull/1063
@StefH commented on GitHub (Jan 30, 2024):
Hello @cezarypiatekGC,
To be backwards compatible, I've added a boolean param to the WireMockConsoleLogger.
And I've updated the testcontainers nuget to use this logger
WireMockNoNewLinesConsoleLogger.And I'll also update the docker project to use this logger by default.
@cezarypiatekGC commented on GitHub (Jan 31, 2024):
Looks like the PR pipeline failed, please let me know when the new image is released.
@StefH commented on GitHub (Jan 31, 2024):
Should be fixed now, you can try the latests preview version.
@StefH commented on GitHub (Feb 8, 2024):
@cezarypiatekGC
Did you try the latest preview version?
@cezarypiatekGC commented on GitHub (Feb 9, 2024):
What's the tag for preview?
@StefH commented on GitHub (Feb 9, 2024):
1.5.47-ci-18350
@cezarypiatekGC commented on GitHub (Feb 9, 2024):
Can't download it from docker hub. Is it publish via different channel?
@StefH commented on GitHub (Feb 9, 2024):
Sorry. I understand now. I did only update the NuGet and the TestContainer NuGet.
If you can review the PR? And if the PR looks good, I'll merge to main and create new official Nuget and create new Docker.
@cezarypiatekGC commented on GitHub (Feb 9, 2024):
Not sure if removing line-endings is a solution here. After shipping logs to store like ElasticSearch they will be unreadable. How do the professional loggers like NLog and SeriLog handle such case?