Javascript Logging

This is a noob question.

What if I want to add logging to the java script application, which is running in a browser (IE, FF, etc.) ? As I understand I can not save log files in the client host. So, I have only two options: display my logging information in a new browser window (like "blackbird") or send the logging to the server.

Is it correct? What kind of logging do they usually use?

Answers


You can't "store" log files on client host. You can open a window and visualize it, but you (assuming you are running the Web Application) will never see it.

If you absolutely must get client side logs, you need to send them back to the server using AJAX. Here's a blog post I really liked about it.


Another possibility is the jsnlog library http://js.jsnlog.com/ It will let you send client side logs to the server.


Need Your Help


About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.