added client and user-agent detection and logging