Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Èròjà atẹ̀lélànà yii ni a ti fi pamọ́ fọ́jọ́ pípẹ́. Jọ̀wọ́ béèrè ìbéèrè titun bí o bá nílò ìrànwọ́.

How do I view the WHOLE console log, not just the most recent entries?

more options

I'm trying to write a userscript and I have it writing to console.log so I can see why when something goes wrong. However, the console log routinely hides most of what I write to it. I can plainly see that, even though the script executes from the beginning, the log starts somewhere in the middle of the script execution, and vital information that I *NEED* is always cut off "above the fold".

I would be willing to settle for: 1.) Seeing ALL the console log entries my script writes, not just the small subset Firefox decides to show me 2.) Logging to a file instead of the console 3.) Using a remote logging service, if there is a free one that works (IE not Loggly). 4.) Running a webserver on my computer and logging via remote calls to that 5.) A way to use JSON.stringify to append the log to tags in the open web page... I actually had this working, but Firefox logs objects as "[object object]" so I can't see them. I already know they're objects, I need to see what they contain!

Any of these would work for me. I just need to be able to look at the log and see the order the various parts of my scripts executed in.

What would NOT work for me is:

1.) Using the script debugger. The problem I'm seeing is very sporadic, and my script uses jQuery, the amount of javascript that executes very quickly is really large, so manually stepping through script execution would require literally hours or days of tapping away, without even being sure the error will occur for me to see. I really need to just be able to use the web normally, and then, when the error occurs, being able to look at the log and see the script execution documented exactly as I set up my console.log commands to do.

The fact that I just spent the better part of two days unable to find a simple solution to the problem of just viewing my script's log entries, is making me think Firefox is not an adequate browser for javascript development. Am I making a mistake trying to develop on Firefox? Is Firefox no good for troubleshooting javascript on?

I'm trying to write a userscript and I have it writing to console.log so I can see why when something goes wrong. However, the console log routinely hides most of what I write to it. I can plainly see that, even though the script executes from the beginning, the log starts somewhere in the middle of the script execution, and vital information that I *NEED* is always cut off "above the fold". I would be willing to settle for: 1.) Seeing ALL the console log entries my script writes, not just the small subset Firefox decides to show me 2.) Logging to a file instead of the console 3.) Using a remote logging service, if there is a free one that works (IE not Loggly). 4.) Running a webserver on my computer and logging via remote calls to that 5.) A way to use JSON.stringify to append the log to tags in the open web page... I actually had this working, but Firefox logs objects as "[object object]" so I can't see them. I already know they're objects, I need to see what they contain! Any of these would work for me. I just need to be able to look at the log and see the order the various parts of my scripts executed in. What would NOT work for me is: 1.) Using the script debugger. The problem I'm seeing is very sporadic, and my script uses jQuery, the amount of javascript that executes very quickly is really large, so manually stepping through script execution would require literally hours or days of tapping away, without even being sure the error will occur for me to see. I really need to just be able to use the web normally, and then, when the error occurs, being able to look at the log and see the script execution documented exactly as I set up my console.log commands to do. The fact that I just spent the better part of two days unable to find a simple solution to the problem of just viewing my script's log entries, is making me think Firefox is not an adequate browser for javascript development. Am I making a mistake trying to develop on Firefox? Is Firefox no good for troubleshooting javascript on?

Ti ṣàtúnṣe nípa Zatukp

All Replies (9)

more options

Zatukp said

I'm trying to write a userscript and I have it writing to console.log so I can see why when something goes wrong. However, the console log routinely hides most of what I write to it. I can plainly see that, even though the script executes from the beginning, the log starts somewhere in the middle of the script execution, and vital information that I *NEED* is always cut off "above the fold".

Is the Console already open when script execution starts? That may be necessary to catch early messages.

Also, are you using the Console in the tab-specific dev tools, or the more comprehensive Browser Console?

Since userscripts are injected by extensions, they may or may not show up in the tab-specific dev tools. Enabling extension debugging (chrome debugging) might help, too.

5.) A way to use JSON.stringify to append the log to tags in the open web page... I actually had this working, but Firefox logs objects as "[object object]" so I can't see them. I already know they're objects, I need to see what they contain!

JSON.stringify() should work, but who wants to read JSON? Try using

console.log(myObject); 

instead of using JSON.stringify(). There are more properties to wade through, but it's still more readable than JSON in most cases.

more options

See also this pref:

  • devtools.hud.loglimit = 10000
more options

cor-el said

See also this pref:
  • devtools.hud.loglimit = 10000

I already had devtools.hud.loglimit set to 1000000000. It didn't help. If I try to set it longer than that, it says the number I entered "is not a number".

Ti ṣàtúnṣe nípa Zatukp

more options

jscher2000 said

Is the Console already open when script execution starts? That may be necessary to catch early messages.

Yes.

Also, are you using the Console in the tab-specific dev tools, or the more comprehensive Browser Console?

The browser console doesn't display any of my console.log messages.

Since userscripts are injected by extensions, they may or may not show up in the tab-specific dev tools.

They only show up in the tab console. The problem is that the beginning of the log gets hidden. The last few hundred entries are always visible in the web console, just as I expect them to be. It's just that the older entries are disappearing. I need to see the whole log, not just the part of it Firefox decides to show me.

5JSON.stringify() should work, but who wants to read JSON? Try using console.log(myObject); instead of using JSON.stringify().

If console.log was working properly, I wouldn't even be posting here. The reason I am stringifying log entries and inserting them into the HTML is because the log is not displaying in full, many entries are being hidden. Console.log cannot insert nodes into HTML.

Ti ṣàtúnṣe nípa Zatukp

more options

One possible hazard is console.clear(). Can you tell whether that is getting called? https://developer.mozilla.org/docs/Web/API/Console/clear

Perhaps an option would be to create a myLog array and push messages/objects onto it as a fallback in case they don't show up in the console.

more options

jscher2000 said

One possible hazard is console.clear(). Can you tell whether that is getting called? https://developer.mozilla.org/docs/Web/API/Console/clear

I don't know how to tell if it's being called, but according to that link it should put a message in the log saying the log was cleared. That's not happening.

Perhaps an option would be to create a myLog array and push messages/objects onto it as a fallback in case they don't show up in the console.

You know, I thought about that. The only problem is, how do I view that array without writing it to console? It's going to be giant, thousands (or even tens of thousands) of entries.

more options

Zatukp said

jscher2000 said
Perhaps an option would be to create a myLog array and push messages/objects onto it as a fallback in case they don't show up in the console.

You know, I thought about that. The only problem is, how do I view that array without writing it to console? It's going to be giant, thousands (or even tens of thousands) of entries.

You could view it in the console on demand if it's a global object (window.myLog). But with that many entries, I'm not sure how you'll find anything in it. I guess my original thought was that if you need to be able to see the initial entries, it could be useful to fill in that part.

more options

jscher2000 said

You could view it in the console on demand if it's a global object (window.myLog).

Hey, that's a good idea! Tip o' the hat!

But with that many entries, I'm not sure how you'll find anything in it.

Yeah, well, I kind of imagined that by 2019 Firefox would have log filtering and searching and stuff... I have to confess at this point, due to having to spend so much time away from development just trying to solve the problems with logging, and the general inability of Firefox's dev tools to be useful for anything at all beyond the most very trivial tinkering without very great difficulty, I'm thinking overall it's just not a browser meant for real development. I'm gonna move on to something else. I guess I'll sacrifice my dignity and all my PII and see if Chrome is any better... there's got to be some reason for its popularity...

Thanks for your efforts.

Ti ṣàtúnṣe nípa Zatukp

more options

There is log filtering and searching, but perhaps you have something else in mind.

https://developer.mozilla.org/en-US/docs/Tools/Web_Console/Console_messages#Filtering_and_searching

The screenshots are old, the search box is now much wider.