Skip to content

Commit

Permalink
Fixes #4487 turned off logging for sites that haven't been upgraded w…
Browse files Browse the repository at this point in the history
…ith ip address column
  • Loading branch information
cash committed Jun 17, 2012
1 parent bc92d10 commit 242ea5f
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions engine/lib/system_log.php
Expand Up @@ -156,16 +156,21 @@ function get_object_from_log_entry($entry_id) {
* This is called by the event system and should not be called directly.
*
* @param object $object The object you're talking about.
* @param string $event String The event being logged
*
* @return mixed
* @param string $event The event being logged
* @return void
*/
function system_log($object, $event) {
global $CONFIG;
static $log_cache;
static $cache_size = 0;

if ($object instanceof Loggable) {

if (datalist_get('version') < 2012012000) {
// this is a site that doesn't have the ip_address column yet
return;
}

// reset cache if it has grown too large
if (!is_array($log_cache) || $cache_size > 500) {
$log_cache = array();
Expand Down Expand Up @@ -213,8 +218,6 @@ function system_log($object, $event) {
$log_cache[$time][$object_id][$event] = true;
$cache_size += 1;
}

return true;
}
}

Expand Down

0 comments on commit 242ea5f

Please sign in to comment.