Enable Socket.IO Debug Logs

Socket.IO uses the debug package internally and exposes namespaces for diagnostic logging.

You can enable detailed logs through the DEBUG environment variable.

For example, on Linux or macOS:

DEBUG=socket.io* npm run dev

On Windows PowerShell:

$env:DEBUG='socket.io*'; npm run dev

This can help identify connection, namespace, and server-side Socket.IO behavior.

Debug logging is useful during development but should be configured carefully in production because detailed logs can increase output volume and expose operational information.

Enable Debug Logging
DEBUG=socket.io* npm run dev

Enables Socket.IO-related debug namespaces while running the application.

Key Takeaways
  • Socket.IO supports detailed debug logging.

  • Debug logs help diagnose connection and event issues.

  • Avoid excessive diagnostic logging in production.