dongyun3805 2010-04-15 17:54 采纳率: 0%
浏览 8
已采纳

扩展Zend_Log以满足特定于应用程序的需求

I am building a Zend Framework application that performs jobs submitted by the user. The actions taken need to be logged to a database. I would like to correlate the job with its log entries.

Instead of creating my own logging class, I would like to extend Zend_Log since it provides 99% of the functionality that I need. All I need to do is add a foreign key of the job id to the log data model.

Is this possible?

I'm also looking for a good example of Zend_Log writing to a database. I haven't searched SO yet. I will do that after I post this.

Thanks in advance...

Steve

  • 写回答

1条回答 默认 最新

  • dsla94915 2010-04-15 18:00
    关注

    It's certainly possible to extend Zend_Log. The framework's code is open, and pretty clean. In the easiest case, you should be able to get going by creating a class in a new file that extends Zend_Log.

    Maybe one of our resident ZF experts can elaborate with more detailed info on how to do this in practice.

    I'm also looking for a good example of Zend_Log writing to a database

    Zend_Log already has a database connector. See here for an example.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 关于大棚监测的pcb板设计
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入