- Socket.IO - Chat Application
- Socket.IO - Internals
- Socket.IO - Logging & Debugging
- Socket.IO - Error Handling
- Socket.IO - Rooms
- Socket.IO - Namespaces
- Socket.IO - Broadcasting
- Socket.IO - Event Handling
- Socket.IO - Hello world
- Socket.IO - Environment
- Socket.IO - Overview
- Socket.IO - Home
Socket.IO Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Socket.IO - Logging & Debugging
Socket.IO uses a very famous debugging module developed by ExpresJS s main author, called debug. Earper Socket.IO used to log everything to the console making it quite difficult to debug the problem. After the v1.0 release, you can specify what you want to log.
Server-side
The best way to see what information is available is to use the * −
DEBUG=* node app.js
This will colorize and output everything that happens to your server console. For example, we can consider the following screenshot.
Cpent-side
Paste this to console, cpck enter and refresh your page. This will again output everything related to Socket.io to your console.
localStorage.debug = * ;
You can pmit the output to get the debug info with incoming data from the socket using the following command.
localStorage.debug = socket.io-cpent:socket ;
You can see the result pke the following screenshot, if you use the second statement to log the info −
There is a very good blog post related to socket.io debugging
Advertisements