Debugging JavaScript

Articles about logging JavaScript are like buses: you wait for ages and then two come along at once.

Over at the newly-redesigned A List Apart, David F.Miller has written an article entitled JavaScript Logging.

Meanwhile, Corey Johnson got in touch to let me know about Lumberjack, a cross-platform JavaScript logger that he’s written.

So what is logging all about and why would you need to do it? Basically, it’s a way of keeping track of what’s going on in your code and, more importantly, where things are going wrong.

For most small, discrete DOM scripts, logging isn’t really necessary. But as your scripts get more advanced and your code gets longer and longer, it might be worth considering one of these solutions. They aren’t intended for the beginner but they could prove useful for anyone who spends a lot of time knee-deep in JavaScript.

Posted by Jeremy on Sunday, September 11th, 2005 at 6:11pm


There are more than only these two busses :-).

Have a look e.g. at It is an API which is very close to the Java version log4j. There is also an AjaxAppender to submit the logs to the server.

# Posted by Stephan Strittmatter on Friday, December 9th, 2005 at 1:38pm

Does anyone know if the Profiling feature of Venkman can be automated ? I’ve used it manually and it’s a great tool that logs calls to functions and processing time. Would be great if this could be automated or if there is another tool that alows that…

# Posted by Scott on Monday, December 19th, 2005 at 6:04pm

Sorry. Comments are closed.

September 2005

Recommended Reading

XML Subscribe

Grab the RSS feed for this blog.

JavaScript API

Grab the RSS feed of comments for this entry.