IConnector logging
The IConnector objects similar strategies also implement the ILogSource interface. Therefore, from the IConnector object you can receive messages through the LogManager by all means that are available for strategies.
IConnector logging example
First, you need to create a log manager:
... private readonly Connector _connector = new Connector(); private readonly LogManager _logManager = new LogManager(); ...
Then you need to create a file logger, and to add it to the LogManager.Listeners:
_logManager.Listeners.Add(new FileLogListener());
The final step is to add the Connector in LogManager.Sources:
_logManager.Sources.Add(_connector);
As a result, the program will display messages as shown below after the start:
18:43:15 | Info | RithmicTrader 18:43:15 | Debug | RithmicTrader | ReadPortfolios() 18:43:15 | Debug | RithmicTrader | OnProcessPortfolios() 18:43:15 | Debug | RithmicTrader | 41469|15152,43|15530,8| 18:43:15 | Debug | RithmicTrader | ReadSecurities() 18:43:15 | Debug | RithmicTrader | OnProcessSecurities 18:43:15 | Debug | RithmicTrader | 291|ESU5|