Re: adding logging to Mason (need advice)
Jeremy Blain <[email protected]>
| Newsgroups | gmane.comp.web.mason.devel |
|---|---|
| Message-ID | <[email protected]> |
Jonathan Swartz wrote: > Mason does virtually no logging beyond fatal errors and a few warns, > and I would like to start adding logging in earnest for 1.3. For example, > > * debug log messages for each request and component start/end, that > can be turned on for troubleshooting > * inform log messages when something mildly interesting happens, like > the code cache being purged > * warning log messages for many situations that are currently fatal - > for example an object file cannot be written > > I was thinking about using log4perl (http://log4perl.sourceforge.net/) > for this purpose. It provides great control over which category of log > messages are generated, it integrates with all of the Log::Dispatch > appenders, and it seems to be well supported. > > However, I've never done anything with this project so would > appreciate hearing about good or bad experiences. > > Would it be easy to add a bunch of log4perl calls to Mason? Should we > require users to install log4perl or somehow make the calls only if > log4perl is available? Does all the flexibility lead to > inefficiencies, e.g., will debug logging calls end up hurting > performance even when the user has this turned off? > > Thanks for any feedback. > > Jon > > I havn't used log4perl, but a logging system of some sort sounds like a great idea. Does the new plugin architecture expose enough functionality to write this as a plugin or set of plugins? Something like: Plugins::Log::Debug Plugins::Log::Fatal Plugins::Log::Inform Doing it as a set of plugins which can be included/excluded should avoid any performance hit, and would also provide a nice set of examples for hooking into various parts of the request for other potential plugin writers. ------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl