How create (in Delphi) a custom EventLog other than on the "Application" node in the Windows EventLog?
//The code below write on the Application node only
with TEventLogger.Create('JarvisAgent') do
begin
try
try
LogMessage(Msg, EVENTLOG_INFORMATION_TYPE, 0, 2);
finally
Free;
end;
except
end;
end;
TEventLogger
uses the older ReportEvent()
API for logging messages. For that API, you have to register a custom log file and its supported event source names, event types, etc in the Registry. Then you can create TEventLogger
using your registered event source name, and messages will go to your registered log file.
This is all documented on MSDN.
Also see: