Hello everyone,
I'm starting to add some logging functionality to my CGI::Application derived webapps, and after a lot of consideration, settled on using Log::Dispatch (by means of the plugin! Thank you, Cees!) rather than rolling my own solution. And so far, it's been great. There's one thing I am trying to do, however, and I'm not sure that I can, or if I can, how to go about it ;)
For worst-case scenarios, I defined my own error runmode so that I can give the user a friendly error page rather than the dreaded "Internal Server Error" page Apache would normally serve up. At some point before or after this, however, I'd like to catch whatever die() messages are being thrown and also log those using Log::Dispatch. In fact, I wouldn't mind catching any warnings either.
I presently have another module that specifically looks for the die and warn signals and logs them to another table. While converting it to Log::Dispatch is trivial, I'd like it if I could keep all of that logic contained within my C::A base application if at all possible. I hate the thought of having to write essentially the same code twice if there's a way that it can be avoided.
Is there a way to do this? How? What would a sample piece of code to do it look like? I'm rather stumped, and maybe it's because I've looked too long and hard at this that there is something simple I'm missing.
Thanks in advance for whatever help you can provide! Jason A. Crome
--------------------------------------------------------------------- Web Archive: http://www.mail-archive.com/[email protected]/ http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2 To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
