Adds event handler for logs.