public override async Task <TResponse> UnaryServerHandler <TRequest, TResponse>( TRequest request, ServerCallContext context, UnaryServerMethod <TRequest, TResponse> continuation) { var response = await continuation(request, context); await context.SetCorrelationId(context.GetCorrelationId()); return(response); }
public override async Task <TResponse> UnaryServerHandler <TRequest, TResponse>( TRequest request, ServerCallContext context, UnaryServerMethod <TRequest, TResponse> continuation) { var response = await base.UnaryServerHandler(request, context, continuation); var correlationId = context.GetCorrelationId(); if (context.Status.StatusCode.Equals(StatusCode.NotFound) || context.Status.StatusCode.Equals(StatusCode.Internal)) { _logger.Error($"[{correlationId}] - Request to '{context.Method}' with '{request.ToString()}' succeeded!"); } else { _logger.Info($"[{correlationId}] - Request to '{context.Method}' with '{request.ToString()}' failed"); } return(response); }