title: Socket.io : How do I handle all incoming messages on the server?
body: <p>I want to be able to handle all messages that are coming in from clients in a single handler.</p>
  
  <p>Example client code:</p>
  
  <pre><code>var socket = io.connect('http://localhost');
  socket.emit('news', { hello: 'test' });
  socket.emit('chat', { hello: 'test' });
  </code></pre>
  
  <p>Example server code:</p>
  
  <pre><code>io.sockets.on('connection', function (socket) {
  socket.on('message', function (data) {
      console.log(data);
  }); });
  </code></pre>
  
  <p>I'd like to be able to log every message even if its sent on news, chat or whatever other name using emit. Is this possible? </p>
  
  <p>Note: The above server code does not work. There is nothing currently logged. I am just wondering if there is a single event which could be handled for all messages for every emit name.  </p>