Nest 2.0 enable tracing

I am updating to the latest version of Nest . Since I am not getting the expected results, I am looking for a replacement for the EnableTrace() method, which was the ConnectionSettings method in previous versions.

+7
nest
source share
1 answer

EnableTrace() will return, but not yet available ( look ).

Now you can use this code to print request and response information:

 var settings = new ConnectionSettings(connectionPool) .DefaultIndex(indexName) .DisableDirectStreaming() .OnRequestCompleted(details => { Debug.WriteLine("### ES REQEUST ###"); if(details.RequestBodyInBytes != null) Debug.WriteLine(Encoding.UTF8.GetString(details.RequestBodyInBytes)); Debug.WriteLine("### ES RESPONSE ###"); if (details.ResponseBodyInBytes != null) Debug.WriteLine(Encoding.UTF8.GetString(details.ResponseBodyInBytes)); }) .PrettyJson(); 

Make sure you set .DisableDirectStreaming() to ConnectionSettings .

Hope this helps.

+20
source share

All Articles