Search code examples
c#loggingquickfixfix-protocol

Quickfix/n, how to disable store and log factories?


How can I disable all of Quickfix/n's log and file factories? I want to handle all logging and message sending myself because I do not like the way how Quickfix sources log messages, meaning I want to decide when and how logging messages originate. Is there a way to completely disable any screen based or file based logging?

Thanks


Solution

  • There should be a NullLogFactory, but I don't currently see one, and I'm kind of confused why not. I thought there was one. (If you didn't know, I maintain QF/n.)

    But you can create one like so:

    public class NullLogFactory : ILogFactory
    {
        SessionSettings settings_;
    
        #region LogFactory Members
    
        public NullLogFactory(SessionSettings settings)
        {}
    
        public ILog Create(SessionID sessionID)
        {
            return new QuickFix.NullLog();
        }
    
        #endregion
    }
    

    The next QF/n release will contain a null factory or something to fill that gap.