[Quickfix-developers] RE: Quickfix-developers digest, Vol 1 #317 - 4 msgs
Brought to you by:
orenmnero
From: Stancescu C. <Con...@sw...> - 2003-09-15 11:41:54
|
#define TRACE_EVENTS 1 #define TRACE_IN 2 #define TRACE_OUT 4 #define TRACE_IN_LOG 8 class CTnsLog : public Log { public: CTnsLog(){ m_traceMask=0; }; virtual void onIncoming( const std::string& ); virtual void onOutgoing( const std::string& ); virtual void onEvent( const std::string& ); void SetTraceMask(std::string traceMask); void EvtLog(const std::string& msg, BSTR trType); private: long m_traceMask; }; class CTnsLogFactory : public LogFactory { public: virtual Log* create( const SessionID& ) ; virtual void destroy( Log* ) ; void SetTraceMask(const SessionID& SessionID, std::string traceMask) ; private: map<SessionID, CTnsLog*> m_mapSessionIDs2Log; }; } void CTnsLog::onIncoming( const std::string& msg) { if ( m_traceMask & TRACE_IN ) EvtLog(msg, L"Incoming"); } void CTnsLog::onOutgoing( const std::string& msg) { if ( m_traceMask & TRACE_OUT ) EvtLog(msg, L"Outgoing"); } void CTnsLog::onEvent( const std::string& msg) { if ( m_traceMask & TRACE_EVENTS ) EvtLog(msg, L"Event"); } // The traceMask is a combination of // E: trace events - recommended // I: trace incoming messages - useful // O: trace outgoing messages - hard core // L: messages go in EventLog (default is TRC_GOLD) void CTnsLog::SetTraceMask(std::string traceMask) { m_traceMask = 0; if ( traceMask.find('E') != traceMask.npos ) m_traceMask |= TRACE_EVENTS; if ( traceMask.find('I') != traceMask.npos ) m_traceMask |= TRACE_IN; if ( traceMask.find('O') != traceMask.npos ) m_traceMask |= TRACE_OUT; if ( traceMask.find('L') != traceMask.npos ) m_traceMask |= TRACE_IN_LOG; } void CTnsLog::EvtLog(const std::string& msg, BSTR trType) { _bstr_t bs = msg.c_str(); if ( m_traceMask & TRACE_IN_LOG ) EVT_INFO(S_OK,(L"FIX::%s %s ",trType, (wchar_t *)bs)); else TRC_TRACE(TRC_GOLD,(L"FIX::%s %s ",trType, (wchar_t *)bs)); } Log* CTnsLogFactory::create( const SessionID& sessionID) { CTnsLog *pLog = new CTnsLog(); m_mapSessionIDs2Log.insert(pair<SessionID, CTnsLog *>(sessionID,pLog)); return pLog; } void CTnsLogFactory::destroy( Log* ) { // tbd xxx } void CTnsLogFactory::SetTraceMask(const SessionID& sessionID, std::string traceMask) { map<SessionID, CTnsLog*>::iterator imap=m_mapSessionIDs2Log.find(sessionID); if ( imap != m_mapSessionIDs2Log.end() ) (*imap).second->SetTraceMask(traceMask); } } This what I use, note that: EVT_INFO is our macro to log in the Windows eventlog TRC_TRACE is our macro to log in a user defined trace file Aorry for the bstr stuff, but we are Windows only... Hope it helps... Constantin -----Original Message----- From: qui...@li... [mailto:qui...@li...] Sent: Freitag, 12. September 2003 05:25 To: qui...@li... Subject: Quickfix-developers digest, Vol 1 #317 - 4 msgs Send Quickfix-developers mailing list submissions to qui...@li... To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/quickfix-developers or, via email, send a message with subject or body 'help' to qui...@li... You can reach the person managing the list at qui...@li... When replying, please edit your Subject line so it is more specific than "Re: Contents of Quickfix-developers digest..." Today's Topics: 1. Logging Options (Jon Dahl) 2. RE: Logging Options (Vitor Castro) 3. How to Handle Logon (Jon Dahl) 4. Sequence number reset during day (Jo Janssens) --__--__-- Message: 1 Date: Thu, 11 Sep 2003 10:25:29 -0500 From: "Jon Dahl" <jd...@Li...> To: <qui...@li...> Subject: [Quickfix-developers] Logging Options Are there currently any options out there to not log the FIX messages - = incoming/outgoing? We have a Market Data Implementation and the log files at the end of the day get rather large. I would assume I would just have to make some = changes to the MessageStoryFactory class or create another SocketInitiator = constructor with no MessageLogFactory class. Any ideas would be appreciated. Oh and finally... a Syslog implementation for the Events log would be a = great help for real time status reporting - any thoughts about this Oren? Thanks, JD --__--__-- Message: 2 From: "Vitor Castro" <vc...@hi...> To: "'Jon Dahl'" <jd...@Li...>, <qui...@li...> Subject: RE: [Quickfix-developers] Logging Options Date: Thu, 11 Sep 2003 16:42:39 +0100 Organization: HiperBit Hi Jon, Changing the constructor would be a way of doing it, but I think that the prefered method would be to implement you own MessageLog Class. Something like a NullMessageLog class that simply would discard the information you aren't interested in. Vitor Castro | DIS <mailto:vc...@hi...> -----Original Message----- From: qui...@li... [mailto:qui...@li...] On Behalf Of Jon Dahl Sent: quinta-feira, 11 de Setembro de 2003 16:25 To: qui...@li... Subject: [Quickfix-developers] Logging Options Are there currently any options out there to not log the FIX messages - incoming/outgoing? We have a Market Data Implementation and the log files at the end of the day get rather large. I would assume I would just have to make some changes to the MessageStoryFactory class or create another SocketInitiator constructor with no MessageLogFactory class. Any ideas would be appreciated. Oh and finally... a Syslog implementation for the Events log would be a great help for real time status reporting - any thoughts about this Oren? Thanks, JD ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Quickfix-developers mailing list Qui...@li... https://lists.sourceforge.net/lists/listinfo/quickfix-developers --__--__-- Message: 3 Date: Thu, 11 Sep 2003 14:10:57 -0500 From: "Jon Dahl" <jd...@Li...> To: <qui...@li...> Subject: [Quickfix-developers] How to Handle Logon How should the Logon Message be handled in Quickfix. I know at startup, the library will send a Logon Message automatically. However, what should I do if I want to add the Username and Password = fields or Reset the Sequence numbers? Should I crack the toAdmin function and filter for the Logon Message and = modify it? Will this mess up the Checksum field and cause a Logout from the = Acceptor side? Thanks, JD --__--__-- Message: 4 Date: Thu, 11 Sep 2003 16:40:54 -0500 From: "Jo Janssens" <jo...@tr...> To: qui...@li... Subject: [Quickfix-developers] Sequence number reset during day This is a multi-part message in MIME format. ------=_NextPart_000_0011_01C37883.7820A4C0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit I had a strange problem today - quickfix seemed to reset the sending sequence number on both of my connections to order execution providers around the same time (18:15 UTC for one, 18:40 UTC for the other). I am using quickfix 1.5.0 C++ I have start and end time set to 11:00:00 and 23:00:00 for one connection and 12:00:00 and 23:00:00 for the other. Any idea why this might happen? I was thinking the session was getting reset but I can't seem to replicate the problem by fiddling with my system clock, so I'm unsure of how to debug this problem. I can send logs if they would be helpful. Thanks, Jo ------=_NextPart_000_0011_01C37883.7820A4C0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable <html xmlns:o=3D"urn:schemas-microsoft-com:office:office" = xmlns:w=3D"urn:schemas-microsoft-com:office:word" = xmlns=3D"http://www.w3.org/TR/REC-html40"> <head> <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; = charset=3Dus-ascii"> <meta name=3DProgId content=3DWord.Document> <meta name=3DGenerator content=3D"Microsoft Word 10"> <meta name=3DOriginator content=3D"Microsoft Word 10"> <link rel=3DFile-List href=3D"cid:filelist.xml@01C37883.77A00310"> <!--[if gte mso 9]><xml> <o:OfficeDocumentSettings> <o:DoNotRelyOnCSS/> </o:OfficeDocumentSettings> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:GrammarState>Clean</w:GrammarState> <w:DocumentKind>DocumentEmail</w:DocumentKind> <w:EnvelopeVis/> <w:Compatibility> <w:BreakWrappedTables/> <w:SnapToGridInCell/> <w:WrapTextWithPunct/> <w:UseAsianBreakRules/> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--> <style> <!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} a:link, span.MsoHyperlink {color:blue; text-decoration:underline; text-underline:single;} a:visited, span.MsoHyperlinkFollowed {color:purple; text-decoration:underline; text-underline:single;} span.EmailStyle17 {mso-style-type:personal-compose; mso-style-noshow:yes; mso-ansi-font-size:10.0pt; mso-bidi-font-size:10.0pt; font-family:Arial; mso-ascii-font-family:Arial; mso-hansi-font-family:Arial; mso-bidi-font-family:Arial; color:windowtext;} span.GramE {mso-style-name:""; mso-gram-e:yes;} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} --> </style> <!--[if gte mso 10]> <style> /* Style Definitions */=20 table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman";} </style> <![endif]--> </head> <body lang=3DEN-US link=3Dblue vlink=3Dpurple = style=3D'tab-interval:.5in'> <div class=3DSection1> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>I had a strange problem today - quickfix seemed to = reset the sending sequence number on both of my connections to order execution = providers around the same time (18:15 UTC for one, 18:40 UTC for the = other).<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>I am using quickfix 1.5.0 = C++<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>I have start and end time set to 11:00:00 and = 23:00:00 for one connection and 12:00:00 and 23:00:00 for the = other.<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>Any idea why this might happen? I was thinking the = session was getting reset but I can’t seem to replicate the problem by = fiddling with my system clock, so I’m unsure of how to debug this = problem…<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>I can send logs if they would be = helpful…<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>Thanks,<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>Jo<o:p></o:p></span></font></p> </div> </body> </html> ------=_NextPart_000_0011_01C37883.7820A4C0-- --__--__-- _______________________________________________ Quickfix-developers mailing list Qui...@li... https://lists.sourceforge.net/lists/listinfo/quickfix-developers End of Quickfix-developers Digest This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this message in error, please notify the sender urgently and then immediately delete the message and any copies of it from your system. Please also immediately destroy any hardcopies of the message. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. The sender's company reserves the right to monitor all e-mail communications through their networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorised to state them to be the views of the sender's company. |