Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eurekalog: save exception stacktrace into a log file

I'm using delphi 7.

I need to log to a file the complete informations of any exception that occurs.

Normally I use Eurekalog. This wonderful product shows a dialog with all the stack trace information and many many others for debugging purpouse.

I need to access this informations Eureka log gives me (really I need just the stack trace) because I need to send them in a syslog deamon. Is there a way to access the information from the Eureka log programmatically ?

I can use the bare delphi 7 or Eurekalog 6.1

like image 877
Jako Avatar asked Aug 13 '12 15:08

Jako


1 Answers

Handle the OnExceptionNotify event. In your event handler, do whatever you want with the AExceptionInfo.CallStack property, such as saving it to disk or sending it to some other process. Note that EurekaLog already saves bug reports to disk by default, so if that's all you want to do, you don't need any special code.

Use RegisterEventExceptionNotify to register your event handler, or use a TEurekaLogV7 component. For details and general information on handling EurekaLog events, see the documentation for the EEvents unit.

OnExceptionNotify occurs for unhandled exceptions. If you want to be notified of any exception, including ones that eventually get handled within your program, then you should use the OnRaise event instead.

like image 197
Rob Kennedy Avatar answered Sep 24 '22 15:09

Rob Kennedy