没有为 quickfix c++ Session 记录日志

Log not being recorded for quickfix c++ Session

我目前是 运行 FIX 发起者并成功连接到接受者。问题是,没有日志被记录。应用程序的.cfg 写在下面。

[DEFAULT]
ConnectionType=initiator
ReconnectInterval=2
ResetOnLogon=Y
FileStorePath=store
FileLogPath=logging
StartTime=00:00:00
EndTime=00:00:00
UseDataDictionary=Y



# standard config elements

[SESSION]
# inherit ConnectionType, ReconnectInterval and SenderCompID from default
BeginString=FIX.4.4
SenderCompID=INIT
TargetCompID=ACCEPT
SocketConnectHost=xxx
SocketConnectPort=xxx
HeartBtInt=30
DataDictionary=FIX44MD.xml

[SESSION]
BeginString=FIX.4.4
SenderCompID=INIT
TargetCompID=ACCEPT1
SocketConnectHost=xxx
SocketConnectPort=xxx
HeartBtInt=30
DataDictionary=FIX44OMS.xml

启动连接的代码摘录如下:

    std::string file = argv[ 1 ];
    FIX::SessionSettings settings( file );
    Application application;
    FIX::FileStoreFactory storeFactory( settings );
    FIX::ScreenLogFactory logFactory( settings );
    FIX::SocketInitiator initiator( application, storeFactory, settings, logFactory);

    initiator.start();
    application.run();
    initiator.stop();

我很确定问题与写入权限无关,因为我是 运行 应用程序的管理员。

那是因为您使用的是 ScreenLogFactory,顾名思义,它只记录到屏幕(例如您的终端)。

将其更改为 FileLogFactory,您应该有生意了。