Seems like unnecessary overhead to me, Bob. Let's say I want to log everything to database, and I want to have a "type" column where I can store "Propel" or "Logon" or "Email" etc. Types of events, essentially, but in addition to the "priority" number.
And now that you mention multiple loggers... how about an Observer Pattern approach? So that any logger registered gets all of the messages, and then we can decide if we want to do something (log it to DB, send an email) inside the logger? - David > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On > Behalf Of Bob Zoller > Sent: Friday, July 01, 2005 9:21 PM > To: Agavi Development > Subject: Re: [agavi-dev] Logging opinions needed > > The way things are currently, you can define multiple Loggers which > the LoggerManager oversees. I think namespaces are effectively > covered by that fact.. for instance: > > === begin logging.ini === > > [loggers] > default = "MyFileAppender" > otherns = "MyOtherNSFileAppender" > > ... etc ... > > === end logging.ini === > > and then you could do: > > LoggingManager::log('my message', 5000); // log to the default logger > LoggingManager::log('my message', 5000, 'otherns'); // log to the otherns > logger > > > That seem like it'll handle what you're wanting to do David? The > question still remains, do we: > > LoggingManager::log('my message', 5000, 'otherns'); > > -or- > > LoggingManager::log(new Message('my message', 5000), 'otherns'); > > ? :) > --Bob > > On 7/1/05, David Zülke <[EMAIL PROTECTED]> wrote: > > What about a "namespace" for messages? So that I can group messages > > together. Would be quite nice. > > > > - David > > > > > > > -----Original Message----- > > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > On > > > Behalf Of Bob Zoller > > > Sent: Friday, July 01, 2005 6:18 AM > > > To: Agavi Development > > > Subject: [agavi-dev] Logging opinions needed > > > > > > I've been working to implement logging recently. So far, I'm happy > > > with what Sean (feti) started. For the most part, I've only filled in > > > the missing code. > > > > > > Yesterday, I stumbled across the Message object. Apparently, Sean was > > > thinking you'd create a Message object and then pass that into the > > > Logger. The Message object extends ParameterHolder, so you'd > > > basically end up calling setParamter() etc.. before passing it on to > > > the logging methods.. > > > > > > something like: > > > > > > $msg = new Message(); > > > $msg->setParameter('message', 'this is my message'); > > > $msg->setParamter('p', 5000); //this is my priority > > > $logger = LoggingManager::getLogger(); > > > $logger->log($msg); > > > > > > What I'm wondering is this: do we really need the Message object? > > > Might we all just agree that when you want something logged, it > > > consists of a) the message (string) and b) a priority or level > > > (integer) ? If so, we could do something like: > > > > > > $logger = LoggingManager::getLogger(); > > > $logger->log('this is my message', 5000); > > > > > > - or even - > > > > > > LoggingManager::log('this is my message', 5000); > > > > > > - or - > > > > > > LoggingManager::log('this is my message', 5000, 'alternativelogger'); > > > > > > > > > If enough of us decide keeping the Message object is the way to go, > > > might I suggest this as our first class to actually utilize > > > __construct().. so we can at least do: > > > > > > LoggingManager::log(new Message('this is my message', 5000)); > > > > > > > > > > > > Feedback appreciated! > > > --Bob > > > _______________________________________________ > > > agavi-dev mailing list > > > [email protected] > > > http://labworkz.com/cgi-bin/mailman/listinfo/agavi-dev > > > > > > > > _______________________________________________ > > agavi-dev mailing list > > [email protected] > > http://labworkz.com/cgi-bin/mailman/listinfo/agavi-dev > > > _______________________________________________ > agavi-dev mailing list > [email protected] > http://labworkz.com/cgi-bin/mailman/listinfo/agavi-dev _______________________________________________ agavi-dev mailing list [email protected] http://labworkz.com/cgi-bin/mailman/listinfo/agavi-dev
