Adam,<div><br></div><div>We found most of the time spent in log4php was parsing the xml configuration etc...</div><div>through xdebug even wheng log level was configured to FATAL and log->debug was invoked.</div><div><br>
</div><div>To avoid un-necessary loss of time in log preference we provided mockup implementation of log4php and moved library to log4php.debug only for developer debug purpose which can be enabled via config.performacne.php</div>
<div><br>Regards,</div><div>Prasad</div><div><br><br><div class="gmail_quote">On Wed, Dec 7, 2011 at 2:14 AM, Adam Heinz <span dir="ltr"><<a href="mailto:amh@metricwise.net">amh@metricwise.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">I recently noticed that log4php/LoggerManager.php has the comment /**<br>
Classes to avoid logging */. This seems a bit counterintuitive to me<br>
-- I would think it would be as simple as dialing down log levels in<br>
log4php.properties, unless the underlying library is painfully slow.<br>
I grabbed the latest tarball from<br>
<a href="http://logging.apache.org/log4php/download.html" target="_blank">http://logging.apache.org/log4php/download.html</a>, dropped it into<br>
include/log4php, deleted the old log4php and log4php.debug folders,<br>
and replaced include/logging.php with<br>
<br>
require_once('config.php');<br>
require_once('include/log4php/Logger.php');<br>
<br>
@include_once('config.performance.php');<br>
global $PERFORMANCE_CONFIG;<br>
if(isset($PERFORMANCE_CONFIG) &&<br>
isset($PERFORMANCE_CONFIG['LOG4PHP_DEBUG']) &&<br>
$PERFORMANCE_CONFIG['LOG4PHP_DEBUG']) {<br>
Logger::configure('log4php.debug.properties');<br>
} else {<br>
Logger::configure('log4php.properties');<br>
}<br>
<br>
class LoggerManager {<br>
static function getlogger($name = 'ROOT') {<br>
return Logger::getLogger($name);<br>
}<br>
}<br>
<br>
I avoided s/LoggerManager/Logger/g for now, but that class is now<br>
easily deleted. I'm not seeing any performance hit hammering my<br>
sandbox (virtual machine, 512MB, 1/4 Opteron CPU). I don't see any<br>
mailing list archives -- would whoever had the original performance<br>
problems like to weigh in? I think this is the right direction to<br>
take the code, but I don't have a load test environment.<br>
_______________________________________________<br>
<a href="http://www.vtiger.com/" target="_blank">http://www.vtiger.com/</a><br>
</blockquote></div><br></div>