Closed Al-Muhandis closed 6 years ago
Hi @Al-Muhandis .
Is it thread-safe to use TEventLog?
Which system do you use? On Linux, it seems TEventLog
uses syslog()
, that is thread safety by itself.
TBrookAction run in a separate thread?
Do you use CGI or FastCGI? Many HTTP server runs CGI in separated processes in an own thread. However, AFAIK there is no a threaded structure for FastCGI in Free Pascal.
Do I need to isolate the logging procedure with Synchronize?
It seems you don't need it, however it depends on your implementation.
Hi @silvioprog
Thanks for the quick reply. I use Linux (Debian). Use TEventLog object with file type logging. ÷I am create an object in an initialization of "brokers" file. I give a small bit of code for clarity from "brokers.pas"
initialization Logger:=TEventLog.Create(nil); Logger.FileName:=AppDir+'iambot.log'; Logger.LogType:=ltFile; Logger.Active:=True; Logger.Info('Журнал запущен');
I record log during the execution of procedure of TBrookAction GET/POST/etc
I use brookframework with FastCGI mode
It seems related to the TEventLog component, but please feel free to reopen if you get any problem related to Brook or wants help in TEventLog.
Is it thread-safe to use TEventLog? TBrookAction run in a separate thread? Do I need to isolate the logging procedure with Synchronize?