[Vtigercrm-developers] apache log4php 2.1.0

Adam Heinz amh at metricwise.net
Tue Dec 6 12:44:40 PST 2011


I recently noticed that log4php/LoggerManager.php has the comment /**
Classes to avoid logging */.  This seems a bit counterintuitive to me
-- I would think it would be as simple as dialing down log levels in
log4php.properties, unless the underlying library is painfully slow.
I grabbed the latest tarball from
http://logging.apache.org/log4php/download.html, dropped it into
include/log4php, deleted the old log4php and log4php.debug folders,
and replaced include/logging.php with

require_once('config.php');
require_once('include/log4php/Logger.php');

@include_once('config.performance.php');
global $PERFORMANCE_CONFIG;
if(isset($PERFORMANCE_CONFIG) &&
isset($PERFORMANCE_CONFIG['LOG4PHP_DEBUG']) &&
$PERFORMANCE_CONFIG['LOG4PHP_DEBUG']) {
	Logger::configure('log4php.debug.properties');
} else {
	Logger::configure('log4php.properties');
}

class LoggerManager {
	static function getlogger($name = 'ROOT') {
		return Logger::getLogger($name);
	}
}

I avoided s/LoggerManager/Logger/g for now, but that class is now
easily deleted.  I'm not seeing any performance hit hammering my
sandbox (virtual machine, 512MB, 1/4 Opteron CPU).  I don't see any
mailing list archives -- would whoever had the original performance
problems like to weigh in?  I think this is the right direction to
take the code, but I don't have a load test environment.



More information about the vtigercrm-developers mailing list