webhook icon indicating copy to clipboard operation
webhook copied to clipboard

FR: add an option controlling how to deal with stderr

Open zhangyoufu opened this issue 1 year ago • 1 comments

In PR #144, cmd.Output() was changed to cmd.CombinedOutput() which captures stderr along with stdout.

However, not every use case benefits from capturing stderr and send out in http body. Stderr is usually being used as the destination for debugging logs/messages. Unexpected output from stderr may disturb stdout and does not match the expected Content-Type of http response body. Many script language may output traceback and relevant source code lines when an exception occurred, and it may not be very obvious how to avoid the leak.

I would like to see an option controlling whether stderr will be captured along with stdout. When not captured, only stdout from hook executables will be sent as http body, and stderr just inherit from webhook (or captured by webhook and output with structured logging, maybe another option).

zhangyoufu avatar May 23 '24 07:05 zhangyoufu

I just came across this project and it's saved me hours of work! I would have found it sooner but searching for "webhook" shows a lot of results 😁 This issue is at the top of my wish list, as I'd like to respond with one thing and write something else to the log.

lovette avatar Aug 20 '24 16:08 lovette