DioxusLabs / DioxusLabs/dioxus

Proxy logs flood terminal and DIOXUS_LOG disables all logs including useful ones

Open
#4,703 0 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
Rust
Stars
39.1k
Forks
1.9k
Avg merge
4d 10h
Merged PRs (30d)
4

Description

**Problem**

All requests to the proxy in [`packages/cli/src/serve/proxy.rs`](https://github.com/DioxusLabs/dioxus/blob/main/packages/cli/src/serve/proxy.rs) ([see code](https://github.com/DioxusLabs/dioxus/blob/main/packages/cli/src/serve/proxy.rs#L148) are logged at the `info` level. When server functions are called frequently, this clogs up the terminal logs. The only way to disable these logs is to run `dx serve` with `DIOXUS_LOG=off`, but this disables all other useful logs from the dx CLI, including those shown in verbose mode, as well as 'rebuild' and 'hot_reload' logs. This behavior is not documented anywhere.

**Steps To Reproduce**

- Use `dx serve` in an app with a frequently-called server function.
- Observe the terminal logs being flooded with proxy request logs at `info` level.
- Try setting `DIOXUS_LOG=off` to suppress these logs.
- Note that all logs (including useful CLI logs) are now disabled.

**Expected behavior**

- Proxy request logs should not flood the terminal during normal usage.
- There should be a way to reduce their verbosity without losing other important logs.
- The use of `DIOXUS_LOG` should be documented in the CLI docs.

**Recommendations**

- Add mention of `DIOXUS_LOG` to the CLI documentation.
- In [`packages/cli/src/serve/proxy.rs`](https://github.com/DioxusLabs/dioxus/blob/main/packages/cli/src/serve/proxy.rs) ([see code](https://github.com/DioxusLabs/dioxus/blob/main/packages/cli/src/serve/proxy.rs#L148)), consider changing `tracing::info!` to `tracing::debug!` or a lower log level for proxy requests.

**Environment:**

- dx version: 0.7.0-rc.0

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.