Only use memory logger in web requests to prevent memory overflow.