client icon indicating copy to clipboard operation
client copied to clipboard

--log-http shouldn't write to stderr

Open duglin opened this issue 5 years ago • 15 comments

When using --log-http it would be nice if it didn't write the log to stderr, but appended to a file (either well-defined name, or value specified by the user). Having that output appear mixed in with the normal output makes it harder to parse/extract. Often I might turn on this option when running a set of scripts so I can decide later if I want to debug it by looking at the http flows. Having all of this output mixed in with the normal output makes it much harder to process.

duglin avatar Aug 25 '19 20:08 duglin

+1 for value specified by the user. We could use existing flag to decide

  • dont print http-logs ---> --log-http not specified
  • print to a file ---> --log-http specified with a filename
  • print with command output ---> --log-http specified without any value

If the http request response to be appended in a file, it would be good if kn command invoked can be written before the request and response, should be useful to identify the kn command and respective request-response (script use case).

navidshaikh avatar Aug 29 '19 09:08 navidshaikh

it would be good if kn command invoked can be written before the request and response

yep!

duglin avatar Aug 29 '19 11:08 duglin

I'm interested in working on this issue.

akerekes avatar Feb 19 '20 20:02 akerekes

@akerekes Thanks a lot for taking over this issue, but I'm not 100% sold that we need this feature that way. Sorry I forgot about this issue (it has been some time).

See my comment at https://github.com/knative/client/pull/683#pullrequestreview-361700746

rhuss avatar Feb 20 '20 08:02 rhuss

My main point is, (a) HTTP logging with body is broken currently (for every sync operation involving a watch, see #485) and (b) we should strive for a more comprehensive solution as described in #333 which makes --log-http obsolete.

Also, I'm not sure that we really deal with log files (which has its own difficulties in case of errors), as we are CLI tool and not a background service. IMO we should all write to stdout, stderr or maybe a custom file descriptor (>2), but let the user decide what todo.

One solution would be to use unique prefixes for the output on which people can grep & tee to create their own logging.

rhuss avatar Feb 20 '20 08:02 rhuss

This issue is stale because it has been open for 90 days with no activity. It will automatically close after 30 more days of inactivity. Reopen the issue with /reopen. Mark the issue as fresh by adding the comment /remove-lifecycle stale.

github-actions[bot] avatar Oct 15 '20 01:10 github-actions[bot]

@akerekes were you going to work on this?

/remove-lifecycle stale

duglin avatar Oct 15 '20 11:10 duglin

This issue is stale because it has been open for 90 days with no activity. It will automatically close after 30 more days of inactivity. Reopen the issue with /reopen. Mark the issue as fresh by adding the comment /remove-lifecycle stale.

github-actions[bot] avatar Jan 14 '21 02:01 github-actions[bot]

/remove-lifecycle stale

rhuss avatar Jan 14 '21 07:01 rhuss

This issue is stale because it has been open for 90 days with no activity. It will automatically close after 30 more days of inactivity. Reopen the issue with /reopen. Mark the issue as fresh by adding the comment /remove-lifecycle stale.

github-actions[bot] avatar Apr 15 '21 01:04 github-actions[bot]

/remove-lifecycle stale

duglin avatar Apr 15 '21 14:04 duglin

This issue is stale because it has been open for 90 days with no activity. It will automatically close after 30 more days of inactivity. Reopen the issue with /reopen. Mark the issue as fresh by adding the comment /remove-lifecycle stale.

github-actions[bot] avatar Jul 15 '21 01:07 github-actions[bot]

/remove-lifecycle stale

duglin avatar Jul 15 '21 03:07 duglin

This issue is stale because it has been open for 90 days with no activity. It will automatically close after 30 more days of inactivity. Reopen the issue with /reopen. Mark the issue as fresh by adding the comment /remove-lifecycle stale.

github-actions[bot] avatar Oct 14 '21 01:10 github-actions[bot]

/remove-lifecycle stale

rhuss avatar Oct 20 '21 10:10 rhuss