3
I am creating an html page that should display the
all browser logs (console.log
). So that when there is
a script error I can access this page and view the browser logs.
3
I am creating an html page that should display the
all browser logs (console.log
). So that when there is
a script error I can access this page and view the browser logs.
-1
You can overwrite the function, but have to overwrite again if the page is updated:
<script>
/* coloque aqui a funcionalidade que deseja */
console.log = function(arg){ alert(arg); };
console.log('ola');
</script>
Abcs!
Browser other questions tagged javascript
You are not signed in. Login or sign up in order to post.
You want to keep the log history? The log is on the client side, probably if you want the logs, you will have to send them to the server and save in a database, for example.
– Filipe Moraes
How do I view these logs in a simple html page via javascript?
– Joandreiy Cordeiro
You can make that happen, see here.
– Ivan Ferrer
I have an offline mobile webapp, sometimes there are some script errors that cannot be seen, I would like to see these errors to fix bugs
– Joandreiy Cordeiro
Ué, but the browser console does not display errors even if offline?
– Ivan Ferrer
I already needed to see in the desktop browser the mobile browser log. For this I used the remote debug functionality of Chrome. Learn more at http://tableless.com.br/debug-remoto-com-chrome-android/
– jefersondaniel
I’ve used these features to debug while I’m developing, but sometimes there are errors when the application is in production, if the browser is Desktop I can see without problem, but when it is mobile I can’t. Why it does not have the function F12 as on the desktop. I would like to devise a way to put the log on a page via javascript. type something like Document.write() that writes directly to the page.
– Joandreiy Cordeiro
Can’t handle the exceptions of the most important blocks (
try
andcatch
, for example) and make an AJAX method to report logs to the server?– Leonardo Pessoa