[prev in list] [next in list] [prev in thread] [next in thread] 

List:       binarycloud-dev
Subject:    [binarycloud-dev] Log updates
From:       Jason Hines <jch () eyeintegrated ! com>
Date:       2003-11-26 7:19:31
[Download RAW message or body]


Another large commit..

* Removed use of exceptions from Conf.  Returns TRUE/FALSE on 
success/failure in GetConf/LoadConf.  We can't rely on catching all conf 
calls.

* System classes Conf files now loaded from init.  (Log / Common / 
Debug) - I added Auth, then realized Auth isn't required for all apps)

* Added more sanity checking in Conf

* Cleaned up Exception some, moving its inclusion from all classes that 
use it.

* Added new level BC_LOG_DEBUG to Log - modded Debug to display them.
   - Changed a few unimportant notices to this new level.

* Renamed Session::CheckStarted to Session::IsStarted =]

* Added constants to Exception:
define("BC_ERR_FATAL", E_USER_ERROR);
define("BC_ERR_ERROR", E_USER_WARNING);
define("BC_ERR_WARNING", E_USER_NOTICE);

Sorta unneeded, but clear.  Exception object uses trigger_error with 
level BC_ERR_FATAL.  (should prolly be configurable in Common)

* New constant BC_PATH_LOGS is [build]/[lang]/logs. (setup by build.xml)

* Added new internal key to log entries 'timestamp'

* Added new configuration file conf/Log.conf.xml.

* Added FileLog, SysLog, MailLog functionalities to Log, using error_log 
and syslog.  (See below **)


After talking with Alex, we agreed that it would be good to log each 
message line by line.. so if the system panics for any reason, the last 
line would be logged.

So, with that in mind:
- Filelog calls are made at every log entry
- Syslog calls are made at every log entry (NOOO)
- Maillog sends are made at system shutdown (Init calls Log->Shutdown)

The syslog call on every entry was a mistake.  With it enabled, its 
horribly slow. For the meantime, disable these features in 
conf/Log.conf.xml.

Left to do:

1. Move syslog call to shutdown, so it dumps the entries instead of line 
by line for performance reasons.
2. There should be a way to decipher which log levels go to which log 
handler. My current thinking is:

<section name="filelog">
    <property name="min_level">BC_LOG_WARNING</property>

So only warnings (and greater) will be logged to file.

3. The log levels still may need tweaking.
Currently it uses the php predefined system constants:

define('BC_LOG_EXCEPTION',  LOG_CRIT);
define('BC_LOG_WARNING',    LOG_WARNING);
define('BC_LOG_NOTICE',     LOG_NOTICE);
define('BC_LOG_DEBUG',      LOG_DEBUG);
define('BC_LOG_OBJ',        LOG_LOCAL0);
define('BC_LOG_VAR',        LOG_LOCAL1);

OBJ and VAR may have to go away, as they are screwing up the order of 
priorities.


jason


















---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@binarycloud.tigris.org
For additional commands, e-mail: dev-help@binarycloud.tigris.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic