Skip to content
  • There are no suggestions because the search field is empty.

SDK logging — How to enable raw XML message logging for the .NET SDK?

Unfortunately, the .NET SDK logs mainly errors and exceptions, it currently does not log raw messages. However, XML messages ("feed traffic log") could be logged via the RawMessage method within event handlers, a simple example var rawMessage = oddsChange.RawMessage.ToString();We even have an example in the SDK Demo Example project: https://github.com/oddin-gg/netcoresdk/blob/develop/src/Oddin.OddsFeedSdk/Oddin.OddsFeedSdkDemoIntegration/GeneralExample.cs#L304GeneralExample.cs

Console.WriteLine($"Raw message: {Encoding.UTF8.GetString(oddsChange.RawMessage.Take(40).ToArray())}...");

The Console.WriteLine should be switched on for the logger in real environments.