ZF-1833: Methods to remove log writers, filters and event items.


I'd like to remove a log writer, and it's not difficult to imagine situations where one would want to remove filters or unset custom event items as well. Perhaps priorities ought to be removable too, for completeness.


Assigning to [~bkarwin] to initiate issue review.

I'm not convinced that this is a requirement that justifies adding API methods.

Can't you just create a different Zend_Log object that doesn't have the writers, filters, custom events or priorities?

Sure, but then I'd have to keep track of the writers/filters/etc I want to keep. I suppose that could be done quite cleanly by subclassing Zend_Log to have getters. Another potential disadvantage would be having to make sure no object keeps a reference to the old Zend_Log.

The workaround I ended up using was subclassing Zend_Log_Writer_Stream with a method to change $_stream at any time. But something like that wouldn't be as easy for Writer_Db, for instance, since its internals are private.

So removing and adding seems to be the simplest and most general solution, but I really don't know how many people would find a need for this.

Are you aware that you can create multiple Zend_Log objects at the same time, and then use the one you need in different parts of your application?

Yes, but then the part that changes the logger has to know about all other parts using the old logger. And that still leaves us with having to remember which parts of the old logger to keep.

Changing to 'Unassigned'

Bulk change of all issues last updated before 1st January 2010 as "Won't Fix".

Feel free to re-open and provide a patch if you want to fix this issue.