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

Disable debug logging in WireMock dotnet tool #844

Closed
wolf8196 opened this issue Nov 5, 2022 · 4 comments
Closed

Disable debug logging in WireMock dotnet tool #844

wolf8196 opened this issue Nov 5, 2022 · 4 comments
Assignees
Labels

Comments

@wolf8196
Copy link
Contributor

wolf8196 commented Nov 5, 2022

Hi.
Is there a way to set log level in WireMock dotnet tool to disable debug messages?
Or disable logging entirely?
It's useful to see request/response when you are setting everything up, but once that's done, those logs are just spam.

From what I understand the logger currently is created in Program.cs with debug level & passed into StandAloneApp logic.

private static readonly IWireMockLogger Logger = new WireMockLogger(xLogger);

And here

The "logger is not null" check will always be true & just reassign the logger, without possibility to override it with console arguments.
And also there is only check for WireMockConsoleLogger, and no way to use the WireMockNullLogger, that probably disables the logging.

Please let me know if I missed something, or of any other way to get rid of request/response logging.
Thank you

@StefH StefH self-assigned this Nov 6, 2022
@StefH
Copy link
Collaborator

StefH commented Nov 6, 2022

@wolf8196
I understand your question, and I've added support for WireMockNullLogger in the command line tool.

Please try preview version: 1.5.9-ci-16630

(https://github.com/WireMock-Net/WireMock.Net/wiki/MyGet-preview-versions)

@StefH
Copy link
Collaborator

StefH commented Nov 6, 2022

The reason I've created an own simple logging class in WireMock, is that I cannot use Microsoft.Extensions.Logging.Abstractions because I'm still supporting older frameworks like 4.5.2 & 4.6

I need to think on this....

@wolf8196
Copy link
Contributor Author

wolf8196 commented Nov 6, 2022

@StefH
Just checked that version. All looks good to me. Thank you

@StefH
Copy link
Collaborator

StefH commented Nov 6, 2022

#845

@StefH StefH closed this as completed Nov 6, 2022
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