Root > Reference > All Functions > ELogOpen

Procedure ELogOpen

Previous pageReturn to chapter overviewNext page   

Creates new log file.







Code (Delphi)

procedure ELogOpen(

const AFileName: String = '';

const ABufferSize: Cardinal = 1024*1024




AFileName [in, opt]

An absolute full file name for the new log file. We recommend to use .csl file extension.


ABufferSize [in, opt]

Size of the buffer in bytes. Default is 1 Mb. Set to 0 to disable buffering.



This function creates new log file. Add subsequent calls to ELog-like functions will write to AFileName.


A call to this function should be the first call in your application (e.g. before you call any of other logging routines).


If non-zero ABufferSize is specified: logging will write into a buffer. Buffer will be flushed to disk from time to time, or you can flush the buffer to disk at any time by calling the ELogFlush function.


If ABufferSize is 0: buffering will be disabled, logging will write directly to the file on disk. Application's performance may be sighnificantly reduced.



If you call any of ELog function before calling this function - log entries will be added to internal log. Internal log will be copied to real log file once you call ELogOpen.


If you do not want old entries created earlier - call ELogClear before calling ELogOpen.



A call to this function may be ignored, if application is already streaming into log file, which is owned by other module (exe/DLL) in application.




Code (Delphi)

ExeName := ParamStr(0);

LogFileName := ChangeFileExt(ExtractFileName(ExeName), '.csl');

LogFolder := ExpandEnvVars('%APPDATA%'); // ESysInfo unit

FullLogFileName := IncludeTrailingPathDelimiter(LogFolder) + LogFileName;




See also

Send feedback... Build date: 2022-03-28
Last edited: 2022-03-28
The documentation team uses the feedback submitted to improve the EurekaLog documentation. We do not use your e-mail address for any other purpose. We will remove your e-mail address from our system after the issue you are reporting has been resolved. While we are working to resolve this issue, we may send you an e-mail message to request more information about your feedback. After the issues have been addressed, we may send you an email message to let you know that your feedback has been addressed.

Permanent link to this article: