在 Zend 应用程序中捕获 error.log 文件中的错误和异常的最佳方法是什么?

发布于 2024-09-24 15:41:58 字数 153 浏览 3 评论 0原文

我想在我的 zend 应用程序中实现错误记录器。我已经创建了用于调试的记录器,但是任何人都可以告诉我记录错误的最佳方法是什么,以便它们在文件中更具可读性。

我见过 Sugarcrm 记录器,它以正确的格式记录错误。有没有人创建过这样的记录器。这样我就可以节省时间。 提前致谢。

I want to implement errorlogger in my zend application. I have created logger which I am using for debugging but Can anybody tell me what is the best way to log errors so that they are more readable in file.

I have seen Sugarcrm logger which logs error in proper format. Does anybody have created logger like this. So that I can save my time.
Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

初懵 2024-10-01 15:41:58

嗯,有 Zend_Log ,它将使使用 zend 记录错误变得非常简单。这是我发现的一些教程

Well there is Zend_Log wich will make loging errors with zend easy as pie. here is some tutorial I found.

预谋 2024-10-01 15:41:58

使用 Log 应用程序资源(加载 Zend_Log)。从 application.ini 文件中进行设置和配置非常容易,并且您可以为不同的环境设置不同的日志记录选项。

如果您不喜欢文本的格式化方式,可以使用 Zend_Log_Formatter 来自定义文本格式。

阅读:http://framework.zend.com/manual/en/zend .log.formatters.html

Use the Log application resource (which loads Zend_Log). It's extremely easy to set up and configure from your application.ini file, and you can set different logging options for different environments.

If you don't like the way the text is formatted, you can use use Zend_Log_Formatter to customize the text format.

Read: http://framework.zend.com/manual/en/zend.log.formatters.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文