[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cgiapp] ANNOUNCE: CGI::Application::Plugin::LogDispatch


On Mon, 13 Dec 2004 10:32:43 +0900, Thilo Planz <suppressed> wrote:
> > I finally got around to wrapping up my Log::Dispatch plugin for
> > CGI::App.  I would appreciate some feedback on the features, and what
> > can be done to improve it.
> 
> I think I like it.
> I did not know about Log::Dispatch before, just Log4Perl, which seemed
> a little too complex for my needs.

That was one of my main reasons for moving to Log::Dispatch.

> I could eliminate a lot of custom logging code from my web apps by
> using this plugin.

That is the point ;)

> A question:
> I am doing two sorts of logging at the moment, the normal STDERR
> logging of warnings (using warn)
> and in addition to that a complete logging of informational messages,
> which are collected in memory
> until the end of the request.
 [SNIP]
> So what I need here is a Log::Dispatcher that logs into a memory
> structure which I can later query
> (and reset for the next request).
> Is there such a module?

It is very easy to write your own custom Log::Dispatch dispatcher.  If
you look at the test suite, I had to create the simplest of in memory
loggers so that I could test the logging functionality properly
without having to bother reading in log files.  You should be able to
get the idea from that code.

> A suggestion:
> CGI::App already has built-in diagnostics functions (the dump()
> runmode).
> Would it make sense for your plugin to include this output
> automatically (at a very low level)?
> Maybe a new option ( CGIAPP_DUMP => 'info' ) ?

You could probably do that yourself already by setting up a dispatcher
that used a custom callback which appended the dump info.  The trick
would be to get the $self object into the callback.

Could you elaborate a little bit more on how you would actually want
it work, and what it would do?

Thanks for the input...

-- 
Cees Hek

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.