phpgroupware-developers
[Top][All Lists]
Advanced

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

RE: [Phpgroupware-developers] Error handling (was include/require statem


From: Dave Hall
Subject: RE: [Phpgroupware-developers] Error handling (was include/require statements)
Date: Thu, 12 May 2005 10:55:56 +1000

On Wed, 2005-05-11 at 16:21 +0200, Kai Hofmann wrote:
> > > > Last but not least I think using require_once along with 
> > set_error_handler
> > > > 
> > > > see http://de.php.net/set_error_handler (works since php 4.0)
> > > > 
> > > > is the best solution, because you have an central error 
> > handler that can
> > > > output error messages and no additional code for every(!) 
> > require statement.
> > > 
> > > this would be ideal :)
> > 
> > Communik8r will be using set_error_handler.  phpLDAPadmin is another
> > good example of its use.
> > 
> > Eventually I would like to see a complex error handling system, which
> > gives users the option of filing bug reports from with in 
> > phpgw.  In my
> > mind it would function like gnome's bug buddy system.  This is a long
> > way off as we don't even use a consistent logging system.
> 
> Sounds like it is a good idea to start with this concept in head now.
> Because we are under development in head, I would like to propose the
> following steps:
> 

Propose or code?

> 1. Change all include,include_once,require to require_once
> 2. Write a central error handler that at its first picks up
>    require_once failures and presence a readable/understandable
>    output to the user.

It will need to handle all errors.  It will also need to be aware of how
it was called.  For example html/xslt/ajax/xmlrpc/soap all require
different ways of sending the error back to the user.

> 3. Create an error report server that can accept automatically error reports

There are several error based reporting solutions within php.  error_log
- goes to httpd log (or other nominated log) or syslog - more control,
including reporting to another server.  I would suggest that we
implement both and allow control through the header.inc.php.  Shared
hosting users will probably use error_log whereas larger installs will
probably prefer the flexibility of syslog.  When running on W[A|I][M|P]P
The syslog functions will use the windows event log.  See
http://php.net/syslog for more info.

> 4. Add functionality for sending out automatically error reports to
>    the greoupware. This kind of feature should be switchable (on/off) by
>    the administrator during setup. (Should be switched off by default for
>    protection of personal data).

I am not sure where you are suggesting the messages are sent to, but it
should be logging them at savannah.  There should be multiple options
controlled through admin->logging

Bugs Reports
Send Reports: Always automatic, Store [default], Never
Notify via email: Yes [default] | No
Notification to: free-text [default blank]
Savannah session_uid: free-text [default blank]
Savannah session_hash: free-text [default blank]
Savannah contact_email: free-text [default blank]

If Savannah session_uid and session_hash are blank the Savannah
contact_email is used.  One of these options is used.

The "Send Reports" store option prepares the report, but does not lodge
it with savannah, it requires sysadmin approval to send the report.  The
savannah bug report id is stored against the report for future
reference.

The bug report would include:

Version, application, error message and debug_backtrace output.  The
report should have a check done to strip passwords and full paths.  the
paths should just be a simple str_replace.  Passwords would involve a
little more work.

Cheers

Dave
-- 
Dave Hall (aka skwashd)
API Coordinator
phpGroupWare
-------------------------------------------------------------------------
Do you think if Bill Gates got laid in high school, do you think there'd 
be a Microsoft?  Of course not.
Underwear Goes Inside The Pants by Lazy Boy





reply via email to

[Prev in Thread] Current Thread [Next in Thread]