Issues

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

Issue Type: Improvement Created: 2007-08-08T11:52:49.000+0000 Last Updated: 2012-11-20T20:53:36.000+0000 Status: Closed Fix version(s): Reporter: Martin Pärtel (lagitus) Assignee: None Tags: - Zend_Log

Related issues: Attachments:

Description

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.

Comments

Posted by Darby Felton (darby) on 2007-08-09T10:30:23.000+0000

Assigning to [~bkarwin] to initiate issue review.

Posted by Bill Karwin (bkarwin) on 2007-08-09T21:23:28.000+0000

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?

Posted by Martin Pärtel (lagitus) on 2007-08-10T00:20:07.000+0000

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.

Posted by Bill Karwin (bkarwin) on 2007-08-10T01:09:07.000+0000

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?

Posted by Martin Pärtel (lagitus) on 2007-08-10T01:42:34.000+0000

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.

Posted by Bill Karwin (bkarwin) on 2007-10-17T15:28:43.000+0000

Changing to 'Unassigned'

Posted by Rob Allen (rob) on 2012-11-20T20:53:36.000+0000

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.

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts