cloudflare / cloudflared

Cloudflare Tunnel client (formerly Argo Tunnel)
https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/tunnel-guide
Apache License 2.0
9.13k stars 802 forks source link

💡add `--log-format` option for tunnel logs #1033

Open drmaples opened 1 year ago

drmaples commented 1 year ago

Describe the feature you'd like The default console output is human friendly text format however the --logfile format is json. When running cloudflared via kubernetes/docker it is nice to have structured logging output to stdout or stderr for consumption by a central logging system like datadog.

It would be useful to add a --log-format option that defaults to human friendlytext output (current behavior) but can log to json format if configured.

--log-format value Console log output format {text, json}. (default: "text")

Describe alternatives you've considered Using --logfile is not an option as the default console logger's output is text format and is what is captured by kubectl logs

Additional context --logfile and --log-directory are already options, --log-format would allow for complete configuration.

JoupainMD commented 1 year ago

👍 it would be really nice to have a feature like this. And also, it would be nice to have some kind of access logs, DEBUG is really too verbose and INFO is really quiet. The best would be to be able to customize the log format (in the way nginx is doing for example, https://nginx.org/en/docs/http/ngx_http_log_module.html#log_format)

In json also it will be 🚀 🚀

nlamirault commented 4 months ago

any news on this issue ?

ruudvanderweijde commented 4 months ago

I'm also highly interested in this.

maxpain commented 1 week ago

any news?

ielkhalloufi commented 6 days ago

Guys, this should be part of the distribution, I was amazed that this is not possible, any updates?