N°6408 - CRUD : Fix log consuming too much memory

This commit is contained in:
Eric Espie
2023-07-12 11:21:32 +02:00
parent 9b409b117f
commit df1cb0b6e3

View File

@@ -612,8 +612,11 @@ abstract class DBObject implements iDisplay
public function Set($sAttCode, $value)
{
if (!utils::StartsWith(get_class($this), 'CMDBChange') && $this->GetKey() > 0) {
// not all the values have __to_string() so print_r is sed and preferred over var_export for the handling or circular references
$this->LogCRUDEnter(__METHOD__, "$sAttCode => ".print_r($value, true));
if (is_object($value) || is_array($value)) {
$this->LogCRUDEnter(__METHOD__, "$sAttCode => object or array");
} else {
$this->LogCRUDEnter(__METHOD__, "$sAttCode => ".print_r($value, true));
}
}
$sMessage = $this->IsReadOnly();