Fixed mysql logging