Implemented Logs code in Query Handler