Add a debug flag
Use 'filter rather than 'for
Stop logging messages sent to defunct clients