Eurekalog:将异常堆栈跟踪保存到日志文件中 [英] Eurekalog: save exception stacktrace into a log file
问题描述
我正在使用delphi 7。
I'm using delphi 7.
我需要将异常的完整信息登录到 strong>发生。
I need to log to a file the complete informations of any exception that occurs.
通常我使用Eurekalog。这个精彩的产品显示了一个对话框,所有的堆栈跟踪信息和许多其他的调试purpouse。
Normally I use Eurekalog. This wonderful product shows a dialog with all the stack trace information and many many others for debugging purpouse.
我需要访问这个信息Eureka日志给我(真的我只需要堆栈跟踪),因为我需要将它们发送到syslog deamon中。
有没有办法从Eureka日志以程式方式访问信息?
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 ?
我可以使用裸露的delphi 7或 Eurekalog 6.1
I can use the bare delphi 7 or Eurekalog 6.1
推荐答案
处理 事件。在您的事件处理程序中,使用 AExceptionInfo.CallStack
属性,例如将其保存到磁盘或将其发送到其他进程。请注意,默认情况下,EurekaLog已经将错误报告保存到磁盘中,所以如果这样做,您就不需要任何特殊代码。
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.
使用 RegisterEventExceptionNotify
注册您的事件处理程序,或使用 TEurekaLogV7
组件。有关处理EurekaLog事件的详细信息和一般信息,请参阅 EEvents单元的文档。
OnExceptionNotify
发生未处理的异常。如果您想收到任何异常的通知,包括最终在程序中处理的异常,那么您应该使用 OnRaise
事件。
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.
这篇关于Eurekalog:将异常堆栈跟踪保存到日志文件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!