Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrectly encoded logger output #1062

Open
cezarypiatekGC opened this issue Jan 30, 2024 · 10 comments
Open

Incorrectly encoded logger output #1062

cezarypiatekGC opened this issue Jan 30, 2024 · 10 comments
Labels

Comments

@cezarypiatekGC
Copy link

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:
image

@StefH
Copy link
Collaborator

StefH commented Jan 30, 2024

#1063

@StefH
Copy link
Collaborator

StefH commented 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
Copy link
Author

Looks like the PR pipeline failed, please let me know when the new image is released.

@StefH
Copy link
Collaborator

StefH commented Jan 31, 2024

Looks like the PR pipeline failed, please let me know when the new image is released.

Should be fixed now, you can try the latests preview version.

@StefH
Copy link
Collaborator

StefH commented Feb 8, 2024

@cezarypiatekGC
Did you try the latest preview version?

@cezarypiatekGC
Copy link
Author

What's the tag for preview?

@StefH
Copy link
Collaborator

StefH commented Feb 9, 2024

1.5.47-ci-18350

@cezarypiatekGC
Copy link
Author

Can't download it from docker hub. Is it publish via different channel?

@StefH
Copy link
Collaborator

StefH commented Feb 9, 2024

Can't download it from docker hub. Is it publish via different channel?

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
Copy link
Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants