Implement logging mechanism