Question

here is my problem: I would like to use and existing Zend_Log instance (instance which already exists in my application) but I would like to write my logs to a different file (same path to log file like in the existing writer but with different name). Do you guys have any idea how can I do this ? so far I only found a solution which is based on a Zend_Log instance + few writers + filter -> each log entry is written to a different file name. Existing Zend_Log instance has a one single writer (instance of Zend_Log_Writer_Stream class). Im under impression that such thing is really trivial but Im not able to find it. My current solution is to create a new instance of Zend_Log and add a new writer. Any suggestions are welcome :) I hope this is not a silly question :D Im not a ZF master.

Was it helpful?

Solution

In the current implementation you cannot detach a writer from a Zend_Log.

Your options are:

  • add new writer to Zend_Log and submit yourself to the fact that there will be two logs.
  • create new Zend_Log with only one writer attached.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top