k6 icon indicating copy to clipboard operation
k6 copied to clipboard

Disable warning / error logs with command line

Open 320IM opened this issue 3 years ago • 2 comments
trafficstars

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

320IM avatar Sep 13 '22 05:09 320IM

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.

na-- avatar Sep 13 '22 16:09 na--

Thank you ,both two work around works

320IM avatar Sep 14 '22 03:09 320IM

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.

imiric avatar Mar 28 '23 14:03 imiric