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.

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

报告相同问题?

悬赏问题

  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码