vite
vite copied to clipboard
logLevel not honored client-side
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
- [x] Follow our Code of Conduct
- [x] Read the Contributing Guidelines.
- [x] Read the docs.
- [x] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [x] Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
- [x] Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- [x] The provided reproduction is a minimal reproducible example of the bug.
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.
Just trying to keep the console clean and meaningful. Most libs provide a flag to disable noisy logs.