Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 633
Michael Avatar asked May 02 '12 18:05

Michael


1 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.

like image 164
Pablo Santa Cruz Avatar answered Oct 16 '22 16:10

Pablo Santa Cruz