forwardBest Bid-Ask Tracking   Table of ContentSecurity Definitions Cacheforward
Logging

TraceSwitch based logging is used. There are four trace switches to make logging flexible.

Handler.TraceSwitch

Trace switch controls Handler-related tracing and debug output. App.config trace switch name is OnixS.CmeMdHandler.

Handler.ReceiversTraceSwitch

Trace switch controls udp receivers-related tracing and debug output. App.config trace switch name is OnixS.CmeMdHandler.Receivers. Received upd packets in base 64 encoding will be added to log with Verbose level.

Handler.FixMessagesTraceSwitch

Trace switch controls fix message processing-related tracing and debug output. App.config trace switch name is OnixS.CmeMdHandler.FixMessages. Decoded fix messages will be added to log with Info level.

Handler.OrderBookTraceSwitch

Trace switch controls order books-related tracing and debug output. App.config trace switch name is OnixS.CmeMdHandler.OrderBook.

Handler trace switches can be configured using either App.config file or static properties of the Handler class.

For example:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>

  <system.diagnostics>
    <switches>
      <!-- This switch controls general messages. In order to receive general trace messages change the value to the appropriate level.          
         "0" gives nothing
         "1" gives error messages, 
         "2" gives error and warning messages, 
         "3" gives error, warning and info messages, 
         "4" gives error, warning, info and verbose messages.
         -->
      <add name="OnixS.CmeMdHandler" value="2"/>
      <add name="OnixS.CmeMdHandler.Receivers" value="2"/>
      <add name="OnixS.CmeMdHandler.FixMessages" value="3"/>
      <add name="OnixS.CmeMdHandler.OrderBook" value="2"/>
    </switches>

    <trace>
      <listeners>
        <remove name="Default" />
        <add name="textWriterTraceListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="TraceLog.txt" />
      </listeners>
    </trace>
  </system.diagnostics>

</configuration>

or:

C#
Handler.TraceSwitch.Level = TraceLevel.Warning;
Handler.ReceiversTraceSwitch = TraceLevel.Warning;
Handler.FixMessagesTraceSwitch = TraceLevel.Info;
Handler.OrderBookTraceSwitch.Level = TraceLevel.Warning;