Skip to content

logLevel not honored client-side #20072

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
7 tasks done
bendytree opened this issue May 20, 2025 · 2 comments
Open
7 tasks done

logLevel not honored client-side #20072

bendytree opened this issue May 20, 2025 · 2 comments

Comments

@bendytree
Copy link

Describe the bug

Looking for a way to silence [vite] ... logs client side in dev and found logLevel under Shared Options, but it doesn't work for client-side vite logs:

export default defineConfig({
  logLevel: 'silent'
});

Results in:

[vite] connecting...
[vite] connected.

Reproduction

https://stackblitz.com/edit/vitejs-vite-abxahfbz?file=vite.config.json

Steps to reproduce

Add logLevel: 'silent' to vite config & reload.

System Info

System:
    OS: macOS 15.4.1
    CPU: (16) arm64 Apple M4 Max
    Memory: 19.31 GB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.11.0 - ~/.nvm/versions/node/v22.11.0/bin/node
    npm: 10.9.0 - ~/.nvm/versions/node/v22.11.0/bin/npm
    pnpm: 10.4.1 - ~/.nvm/versions/node/v22.11.0/bin/pnpm
  Browsers:
    Chrome: 136.0.7103.114
    Safari: 18.4
    Safari Technology Preview: 18.4
  npmPackages:
    @vitejs/plugin-vue: ^4.2.3 => 4.6.2 
    vite: ^4.3.9 => 4.5.14

Used Package Manager

npm

Logs

[vite] connecting...
[vite] connected.

Validations

@bluwy
Copy link
Member

bluwy commented May 21, 2025

It only works for the server-side. Is there a reason you want to apply them in the client too? For those logs you mentioned specifically, those are logged with console.debug which you can filter away from the devtools console.

@bendytree
Copy link
Author

Just trying to keep the console clean and meaningful. Most libs provide a flag to disable noisy logs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants