Console.log in Deploy Logs

Sometime in the past couple months I’ve noticed that my console.log()s aren’t showing up in my deploy logs. For instance, this log: Netlify App

This is Nuxt.js based build and I would expect to see logs like I see when running nuxt generate locally. For instance,

✔ Generated route "/press-room"       19:57:50

That is an example of a Nuxt generate log line for an individual generated route. I would also expect to see these lines:

  Adding server side redirects    
  Creating JSON data for Shopify  
  Fetching data for route generation

These are console.log() lines that I’ve added myself via Nuxt modules. My logs used to show up. Is this a known change to Netlify? The output from other parts of the build process, like Webpack, is rendering.

Hey @weotch,
I don’t know of anything on our end like that, although that absolutely doesn’t mean that it didn’t happen (how’s that for a confusing sentence). After reading through this:

I’m wondering if there may have been a change on the Nuxt side? Could that be possible?

Wow, thanks for that research!

Here’s why I think it’s not on Nuxt’s end. Here is a deploy log from June 4 where I see full Nuxt logging (like I see the list of generated routes): Netlify App. For instance:

3:18:00 PM: 22:18:00 ✔ Generated /work/kitty-hawk
3:18:00 PM: 22:18:00 ✔ Generated /work/amazon

The next deploy on this project is from June 16th and is a webhook deploy (not a code change): Netlify App. In that log (and in all subsequent ones), I no longer see the list of generated routes.

In that thread you found, they talked about setting the logging output based on log levels. Do you know what log level the Netlify build process executes commands with? Maybe Netlify started emitting a log level between June 4th and 16h time and that’s what caused some of the logging to be suppressed.

Ah, I think that what you describe coincides with this change: New CI=true build configuration, "Treating warnings as errors because process.env.CI = true". Nuxt may be changing its logging based on the env var CI. If you want the old behavior, can you try adding the env var CI=true in your site’s build settings? Let me know if that helps.

Adding CI= before my build command did the trick. Thus: CI= yarn generate. Thanks for the point in the right direction!

Just a quick heads up that setting CI= doesn’t seem to get you nuxt generate logs anymore. At least not for me. Setting the quiet build option to false in nuxt.config.js does though. See Nuxt - The build Property

1 Like

Thanks for coming back and sharing this with us, @eriklindgren :netliconfetti:

The quiet flag on the nuxt.config.js is not working anymore. Is there a workaround for this?

Hi @allansolutions1,

If you can share your site name, repo or some additional details that might be helpful, we can look into this.

It was in the wrong place. Thanks for the quick response! It is working for me now