Bug/feature: console log limit

Suddenly my backend code stopped working. Somewhere right in the middle. Took me hours to find out that the code kept on running, but it no longer showed console.log (backend) output. Yes, it was a lot. When I reduced console output, everything was fine.

So, it looks like there is a limit to what backend console.log can handle. Is this a bug or a feature?

1 Like

I guess the editor console memory is tiny? It’s also kind of annoying that there’s no console.table() as it’s super useful for object parsing.

Not sure if that’s a bug, or a “feature” that is not behaving nicely. I’m going to send this on to QA for them to evaluate.

@giri-zano Are you speaking about the editor console, dashboard console or google stack?

If I were you use I would you one latest as suggested in the following post

You can also try using the site monitoring feature which is more robust, more flexible, and more powerful.

Thanks guys, appreciate the help. Looked at the site monitor, but I like console.log in editor better.

Hi @giri-zano
Could you please give more details about your use case?

Are you using a backend function which reports you console.logs and your browser dev console to see if this function is still working? So it is some sort of health monitoring? Or is it just for debugging purposes?

When you’re saying that it was a lot of logs - what do you mean? Was the function called frequently or it just sends a lot of logs when called once? For how long was the browser session opened? Is it days or hours?

Also, i’d be grateful if you could give at least approx. numbers: how many log lines were you expecting to see and how many you actually saw? If that’s possible to count, of course.

Thank you in advance. Meanwhile I’ll check if there are any limits on our side.

Thanks for getting back. I will try to answer you questions asap, will have to redo it. But so far it was this:

  1. only backend functions for debugging (lots of code, no UI yet)
  2. I console.time´d it, aprox running time anywhere between 2 and 4 secs

I´ll get back to you with more data (e.g. save log file in Notepad and see if file size rings a bell), ok?

@giri-zano That would be awesome, thanks!

@giri-zano Hello. Wanted to update you with my findings.
Indeed, there is a limitation in console logs you can receive from the backend for safety reasons. Currently it is set to 500 logs. I already asked our developers if it is possible to expand this limit.
Also, frontend logs doesn’t have this limitation.

As a better solution I’d recommend to use our site monitoring tool, which has really powerful logging abilities and can be integrated with Google Stackdriver. You can read more about it here

Regards, Alex

@aleksander-denga In case it cannot be capped at a higher number, would you please suggest that they add an error message for this instance?

@skmedia I think a warning once the limit is reached is better since no error occurred

@plomteuxquentin @skmedia Sounds like a good idea, I’ll suggest it to them, of course. Thank you

Yes, I agree, an error “Backend log limit reached (500)” would be better, since any limit you put in will at one time be exceeded by someone. 500 should be enough. The reason that I ran into it was because I stupidly did a global search-replace for "//console.log → console.log. Should not have done that, also started logging again functions that were finished.