PMCORE-1335 ProcessMaker core should be use the native Laravel log mechanism.

This commit is contained in:
Roly Rudy Gutierrez Pinto
2020-08-10 17:11:55 -04:00
parent 061d4531f1
commit c865e65658
45 changed files with 731 additions and 1535 deletions

View File

@@ -2,6 +2,7 @@
use App\Jobs\GenerateReportTable;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use ProcessMaker\Core\JobsManager;
use ProcessMaker\Core\System;
use ProcessMaker\Model\Application;
@@ -1033,10 +1034,9 @@ class AdditionalTables extends BaseAdditionalTables
if ($externalResultSet->next()) {
$stringCount = $externalResultSet->getInt(1);
}
} catch (Exception $externalException) {
$context = Bootstrap::getDefaultContextLog();
$context = array_merge($context, $row);
Bootstrap::registerMonolog("additional tables", 400, $externalException->getMessage(), $context);
} catch (Exception $e) {
$message = $e->getMessage();
Log::channel(':additional tables')->error($message, Bootstrap::context($row));
}
}
}

View File

@@ -2,6 +2,8 @@
require_once 'classes/model/om/BaseAppAssignSelfServiceValueGroup.php';
use Illuminate\Support\Facades\Log;
/**
* Skeleton subclass for representing a row from the 'APP_ASSIGN_SELF_SERVICE_VALUE_GROUP' table.
* You should add additional methods to this class to meet the
@@ -48,10 +50,12 @@ class AppAssignSelfServiceValueGroup extends BaseAppAssignSelfServiceValueGroup
{
$object = $this->getTypeUserOrGroup($id);
if ($object->id === -1) {
$dataLog = Bootstrap::getDefaultContextLog();
$dataLog['ASSIGNEE_ID'] = $id;
$dataLog['ASSIGNEE_TYPE'] = $object->type;
Bootstrap::registerMonolog('AssignSelfServiceValue', 300, 'Invalid identifier value for Assign Self Service Value', $dataLog, $dataLog['workspace'], 'processmaker.log');
$message = 'Invalid identifier value for Assign Self Service Value';
$context = [
'ASSIGNEE_ID' => $id,
'ASSIGNEE_TYPE' => $object->type
];
Log::channel(':AssignSelfServiceValue')->warning($message, Bootstrap::context($context));
} else {
$sql = "INSERT INTO "
. AppAssignSelfServiceValueGroupPeer::TABLE_NAME