I writing my filter that running after a sever method call and print its content to Console. The code is written in ASP.NET core v2.1:
public class MyCustomF
It all depends on what do you want to achieve. If you want to get the response values or just to see the result you can use
context.Result or context.Result.Value
If you want to modify the response or just to log the entire response you should use a middleware.
here is a good example https://exceptionnotfound.net/using-middleware-to-log-requests-and-responses-in-asp-net-core/
hope it helps