Next.js: [Next.js 9] Setting `quiet: true` flag doesn't seem to work anymore

Created on 19 Aug 2019  路  7Comments  路  Source: vercel/next.js

Bug report

Describe the bug

Using custom server with quiet: true flag set doesn't affect logging.
It still shows a bunch of next.js specific logs in stdout even after setting the flag:

> node index.js

[ ready ] compiled successfully
[ wait ]  compiling ...
> Ready on http://localhost:3000
[ ready ] compiled successfully
[ event ] client pings, but there's no entry for page: /a
[ event ] build page: /next/dist/pages/_error
[ wait ]  compiling ...
[ ready ] compiled successfully
[ event ] build page: /
[ wait ]  compiling ...
[ ready ] compiled successfully

To Reproduce

  1. Run npx create-next-app
  2. Create a file index.js in the project root and fill out the content as stated in the document
  3. Replace the line const app = next({dev}); by const app = next({dev, quiet: true});
  4. Run node index.js
  5. See the output

Expected behavior

I expected next.js to disable log outputs in stdout by setting quiet: true flag.

Screenshots

image

System information

  • OS: macOS
  • chrome
  • Next.js v9.0.3
  • Node v12.6.0

Related issues

Most helpful comment

The real issue is that, since you are using custom server logic and the standard output stream is shared by both next and your server, there鈥檚 no ideal way to selectively pipe next logs to /dev/null. You will always have to lose all your logs along with next鈥檚 in that way.

All 7 comments

Hey, quiet: true is just for error logs, you can read about it in the documentation.

Ah, that鈥檚 true. I didn鈥檛 notice that.

Apart from that, I still wonder if there鈥檚 a way to disable logging in custom server.

Any thoughts?

Maybe I have to file another issue?

Hi @preco21 what's the reason for wanting to disable it? The particular lines that you posted are development-only and contribute to a good dx.

@timneutkens The reason is because, I use standard output as a main logging point in the development environment. And this is what next.js also consumes to. In turn, you will end up having mixed log output in your terminal that can confuse you from reading the output of other logs.

But in that case you could just pipe to /dev/null right? next > /dev/null

The real issue is that, since you are using custom server logic and the standard output stream is shared by both next and your server, there鈥檚 no ideal way to selectively pipe next logs to /dev/null. You will always have to lose all your logs along with next鈥檚 in that way.

Same as #4808

Was this page helpful?
0 / 5 - 0 ratings