ClearBox Server v1.2 Developer's Guide | ||||||||||||||
ILivingstonAccounting::SetLoggingOptionsServer extension should call this method or SetLoggingOptionsEx to set logging options prior to using LogPacket method. This method provides only basic set logging options, using default values for other, while SetLoggingOptionsEx allows to specify all possible logging parameters. HRESULT SetLoggingOptions( [in] BSTR fileName, [in] BSTR fileNameExtension, [in] ROLLOVERMODE rllvrMode); Parameters
Return ValuesThis method may return E_INVALIDARG if fileName is NULL. Thread SafetyThis method can be called from any thread. Memory ManagementServer extension should allocate and free memory for fileName and fileNameExtension parameters. RemarksThis method may be called not only before the first call to LogPacket. Calling this method doesn't affect existing logfile. It's common case to use it from ICommonExtender::InitializeEx. Example CodeThis code uses m_pServer as IServer interface pointer stored in ICommonExtenderEx::InitializeEx implementation. It makes server logging accounting data into the file c:\Logs\MyLog_20030330.txt, for example, and the next file name is c:\Logs\MyLog_20030331.txt after 24 hours will elapse. ILivingstonAccounting* pAcc=NULL; m_pServer->QueryInterface(IID_ILivingstonAccounting,(void**)&pAcc; //QueryInterface will always succeed BSTR fName=SysAllocString(L"c:\\Logs\\Mylog_"); BSTR fExt=SysAllocString(L"txt"); pAcc->SetLoggingOptionsEx(fName,fExt,RM_DAILY); SysFreeString(fName); SysFreeString(fExt); // Call to pAcc->Release() is not necessary See AlsoILivingstonAccounting, Server services, SetLoggingOptionsEx, LogPacket © 2001-2003 XPerience Technologies. www.xperiencetech.com |
Created by chm2web html help conversion utility. |