-Added logging mechanism