k6
k6 copied to clipboard
Disable warning / error logs with command line
Feature Description
While doing the soak test , got too much below error, consumed huge space to save logs level=warning msg="Request Failed" error="Post "**** connect: cannot assign requested address"
Suggested Solution (optional)
have a flag that user can disable popup it.
Already existing or connected issues / PRs (optional)
No response
Thanks for opening this issue! It is a bit of a duplicate of https://github.com/grafana/k6/issues/1681, but it's more targeted and something that should probably be considered for the new HTTP API we have planned (https://github.com/grafana/k6/issues/2461), so I'll leave it open. I also opened an issue for the httpx library on jslib.k6.io, to potentially explore some simpler JS solutions in the meantime.
Until we have any of that, you can write your own wrapper that catches exceptions when throw is true and just ignores them, or one of the other workarounds mention in https://github.com/grafana/k6/issues/1681#issuecomment-787978692.
Thank you ,both two work around works
Given that there are acceptable workarounds for this, I'll close the issue.
As a sidenote, I don't see this as being part of the HTTP API, but as something that should be addressed globally in #1681. After all, the HTTP API will only log events, and it's not concerned with how those events are shown to the user.