added recording logs into mysql