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: https://app.netlify.com/sites/clifbar/deploys/5f72a4a913ea5200081c2ccf

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): https://app.netlify.com/sites/bukwild/deploys/5ed9723afc985b000722c075. 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): https://app.netlify.com/sites/bukwild/deploys/5ee95d8196ea08a59c6f64a5. 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!