Merged in bugfix/PMCORE-1335 (pull request #7332)
PMCORE-1335 ProcessMaker core should be use the native Laravel log mechanism Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
This commit is contained in:
committed by
Julio Cesar Laura Avendaño
commit
5e8d0a8f02
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use ProcessMaker\BusinessModel\EmailServer;
|
||||
use ProcessMaker\Core\System;
|
||||
use ProcessMaker\Services\Api\Project\Variable;
|
||||
@@ -565,11 +566,11 @@ class ActionsByEmailCoreClass extends PMPlugin
|
||||
if (empty($data->DEL_INDEX)) {
|
||||
throw new Exception('The parameter $data->DEL_INDEX is null or empty.');
|
||||
} elseif ($data->DEL_INDEX === 1) {
|
||||
// Processmaker log
|
||||
$context = Bootstrap::getDefaultContextLog();
|
||||
$context['delIndex'] = $data->DEL_INDEX;
|
||||
Bootstrap::registerMonolog('ActionByEmail', 250, 'Actions by email does not work in the initial task', $context);
|
||||
|
||||
$message = 'Actions by email does not work in the initial task';
|
||||
$context = [
|
||||
'delIndex' => $data->DEL_INDEX
|
||||
];
|
||||
Log::channel(':ActionByEmail')->notice($message, Bootstrap::context($context));
|
||||
return;
|
||||
} else {
|
||||
$this->setIndex($data->DEL_INDEX);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use ProcessMaker\BusinessModel\Task as BusinessModelTask;
|
||||
use ProcessMaker\BusinessModel\User as BusinessModelUser;
|
||||
use ProcessMaker\BusinessModel\WebEntryEvent;
|
||||
@@ -1106,7 +1107,12 @@ class Cases
|
||||
$oDerivation->verifyIsCaseChild($sAppUid);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
Bootstrap::registerMonolog('DeleteCases', 200, 'Error in sub-process when trying to route a child case related to the case', ['application_uid' => $sAppUid, 'error' => $e->getMessage()], config("system.workspace"), 'processmaker.log');
|
||||
$message = 'Error in sub-process when trying to route a child case related to the case';
|
||||
$context = [
|
||||
'application_uid' => $sAppUid,
|
||||
'error' => $e->getMessage()
|
||||
];
|
||||
Log::channel(':DeleteCases')->info($message, Bootstrap::context($context));
|
||||
}
|
||||
|
||||
//Delete the registries in the table SUB_APPLICATION
|
||||
@@ -1160,12 +1166,13 @@ class Cases
|
||||
}
|
||||
}
|
||||
|
||||
/** ProcessMaker log*/
|
||||
$context = Bootstrap::getDefaultContextLog();
|
||||
$context['appUid'] = $appUidCopy;
|
||||
$context['request'] = $nameFiles;
|
||||
Bootstrap::registerMonolog('DeleteCases', 200, 'Delete Case', $context);
|
||||
|
||||
/** ProcessMaker log */
|
||||
$message = 'Delete Case';
|
||||
$context = [
|
||||
'appUid' => $appUidCopy,
|
||||
'request' => $nameFiles
|
||||
];
|
||||
Log::channel(':DeleteCases')->info($message, Bootstrap::context($context));
|
||||
return $result;
|
||||
} catch (exception $e) {
|
||||
throw ($e);
|
||||
@@ -2266,7 +2273,8 @@ class Cases
|
||||
}
|
||||
|
||||
//Log
|
||||
$data = [
|
||||
$message = 'Create case';
|
||||
$context = $data = [
|
||||
"appUid" => $sAppUid,
|
||||
"usrUid" => $sUsrUid,
|
||||
"tasUid" => $sTasUid,
|
||||
@@ -2275,8 +2283,7 @@ class Cases
|
||||
"delIndex" => $iDelIndex,
|
||||
"appInitDate" => $Fields['APP_INIT_DATE']
|
||||
];
|
||||
Bootstrap::registerMonolog('CreateCase', 200, "Create case", $data, config("system.workspace"), 'processmaker.log');
|
||||
|
||||
Log::channel(':CreateCase')->info($message, Bootstrap::context($context));
|
||||
//call plugin
|
||||
if (class_exists('folderData')) {
|
||||
$folderData = new folderData($sProUid, $proFields['PRO_TITLE'], $sAppUid, $newValues['APP_TITLE'], $sUsrUid);
|
||||
@@ -5524,17 +5531,19 @@ class Cases
|
||||
$from = $fromName . (($fromMail != '') ? ' <' . $fromMail . '>' : '');
|
||||
//If the configuration was not configured correctly
|
||||
if (empty($fromMail)) {
|
||||
$dataLog = \Bootstrap::getDefaultContextLog();
|
||||
$dataLog['appUid'] = $arrayData['APPLICATION'];
|
||||
$dataLog['usrUid'] = $arrayData['USER_LOGGED'];
|
||||
$dataLog['appNumber'] = $arrayData['APP_NUMBER'];
|
||||
$dataLog['tasUid'] = $arrayData['TASK'];
|
||||
$dataLog['proUid'] = $aTaskInfo['PRO_UID'];
|
||||
$dataLog['appMessageStatus'] = 'pending';
|
||||
$dataLog['subject'] = $sSubject;
|
||||
$dataLog['from'] = $from;
|
||||
$dataLog['action'] = G::LoadTranslation('ID_EMAIL_SERVER_FROM_MAIL_EMPTY');
|
||||
Bootstrap::registerMonolog('EmailServer', 300, 'Email server', $dataLog, $dataLog['workspace'], 'processmaker.log');
|
||||
$message = 'Email server';
|
||||
$context = [
|
||||
'appUid' => $arrayData['APPLICATION'],
|
||||
'usrUid' => $arrayData['USER_LOGGED'],
|
||||
'appNumber' => $arrayData['APP_NUMBER'],
|
||||
'tasUid' => $arrayData['TASK'],
|
||||
'proUid' => $aTaskInfo['PRO_UID'],
|
||||
'appMessageStatus' => 'pending',
|
||||
'subject' => $sSubject,
|
||||
'from' => $from,
|
||||
'action' => G::LoadTranslation('ID_EMAIL_SERVER_FROM_MAIL_EMPTY')
|
||||
];
|
||||
Log::channel(':EmailServer')->warning($message, Bootstrap::context($context));
|
||||
}
|
||||
}
|
||||
$dataLastEmail['msgError'] = $msgError;
|
||||
@@ -5605,17 +5614,19 @@ class Cases
|
||||
$from = $fromName . (($fromMail != '') ? ' <' . $fromMail . '>' : '');
|
||||
//If the configuration was not configured correctly
|
||||
if (empty($fromMail)) {
|
||||
$dataLog = \Bootstrap::getDefaultContextLog();
|
||||
$dataLog['appUid'] = $arrayData['APPLICATION'];
|
||||
$dataLog['usrUid'] = $arrayData['USER_LOGGED'];
|
||||
$dataLog['appNumber'] = $arrayData['APP_NUMBER'];
|
||||
$dataLog['tasUid'] = $arrayData['TASK'];
|
||||
$dataLog['proUid'] = $aTaskInfo['PRO_UID'];
|
||||
$dataLog['appMessageStatus'] = 'pending';
|
||||
$dataLog['subject'] = $sSubject;
|
||||
$dataLog['from'] = $from;
|
||||
$dataLog['action'] = G::LoadTranslation('ID_EMAIL_SERVER_FROM_MAIL_EMPTY');
|
||||
Bootstrap::registerMonolog('EmailServer', 300, 'Email server', $dataLog, $dataLog['workspace'], 'processmaker.log');
|
||||
$message = 'Email server';
|
||||
$context = [
|
||||
'appUid' => $arrayData['APPLICATION'],
|
||||
'usrUid' => $arrayData['USER_LOGGED'],
|
||||
'appNumber' => $arrayData['APP_NUMBER'],
|
||||
'tasUid' => $arrayData['TASK'],
|
||||
'proUid' => $aTaskInfo['PRO_UID'],
|
||||
'appMessageStatus' => 'pending',
|
||||
'subject' => $sSubject,
|
||||
'from' => $from,
|
||||
'action' => G::LoadTranslation('ID_EMAIL_SERVER_FROM_MAIL_EMPTY')
|
||||
];
|
||||
Log::channel(':EmailServer')->warning($message, Bootstrap::context($context));
|
||||
}
|
||||
}
|
||||
$dataLastEmail['msgError'] = $msgError;
|
||||
@@ -7364,6 +7375,7 @@ class Cases
|
||||
$additionalTables = new AdditionalTables();
|
||||
$listTables = $additionalTables->getReportTables($applicationFields["PRO_UID"]);
|
||||
$pmTable = new PmTable();
|
||||
$tableName = '';
|
||||
foreach ($listTables as $row) {
|
||||
try {
|
||||
$tableName = $row["ADD_TAB_NAME"];
|
||||
@@ -7374,11 +7386,13 @@ class Cases
|
||||
$criteria->add($pmTablePeer::APP_UID, $applicationUid);
|
||||
$pmTablePeer::doDelete($criteria);
|
||||
} catch (Exception $e) {
|
||||
$context = Bootstrap::getDefaultContextLog();
|
||||
$context['appUid'] = $applicationUid;
|
||||
$context['proUid'] = $applicationFields["PRO_UID"];
|
||||
$context['reportTable'] = $tableName;
|
||||
Bootstrap::registerMonolog('DeleteCases', 400, $e->getMessage(), $context);
|
||||
$message = $e->getMessage();
|
||||
$context = [
|
||||
'appUid' => $applicationUid,
|
||||
'proUid' => $applicationFields["PRO_UID"],
|
||||
'reportTable' => $tableName
|
||||
];
|
||||
Log::channel(':DeleteCases')->error($message, Bootstrap::context($context));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Route case
|
||||
*/
|
||||
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use ProcessMaker\Model\Application as ModelApplication;
|
||||
use ProcessMaker\Model\SubApplication as ModelSubApplication;
|
||||
|
||||
@@ -138,8 +135,8 @@ class Derivation
|
||||
|
||||
$arrayApplicationData = $this->case->loadCase($arrayData["APP_UID"]);
|
||||
|
||||
$arrayNextTask = array();
|
||||
$arrayNextTaskDefault = array();
|
||||
$arrayNextTask = [];
|
||||
$arrayNextTaskDefault = [];
|
||||
$i = 0;
|
||||
|
||||
$criteria = new Criteria("workflow");
|
||||
@@ -168,7 +165,7 @@ class Derivation
|
||||
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
$flagDefault = false;
|
||||
$aSecJoin = array();
|
||||
$aSecJoin = [];
|
||||
$count = 0;
|
||||
|
||||
while ($rsCriteria->next()) {
|
||||
@@ -228,7 +225,7 @@ class Derivation
|
||||
//Check Task GATEWAYTOGATEWAY, END-MESSAGE-EVENT, END-EMAIL-EVENT
|
||||
$arrayNextTaskBackup = $arrayNextTask;
|
||||
|
||||
$arrayNextTask = array();
|
||||
$arrayNextTask = [];
|
||||
$i = 0;
|
||||
foreach ($arrayNextTaskBackup as $value) {
|
||||
$arrayNextTaskData = $value;
|
||||
@@ -694,7 +691,7 @@ class Derivation
|
||||
}
|
||||
|
||||
//Element origin and dest
|
||||
$arrayElement = array();
|
||||
$arrayElement = [];
|
||||
$elementTaskRelation = new \ProcessMaker\BusinessModel\ElementTaskRelation();
|
||||
$arrayElementTaskRelationData = $elementTaskRelation->getElementTaskRelationWhere(
|
||||
[
|
||||
@@ -705,7 +702,7 @@ class Derivation
|
||||
true
|
||||
);
|
||||
if(is_null($arrayElementTaskRelationData)){
|
||||
$arrayOtherElement = array();
|
||||
$arrayOtherElement = [];
|
||||
$arrayOtherElement = $bpmn->getElementsBetweenElementOriginAndElementDest(
|
||||
$elementOriUid,
|
||||
"bpmnActivity",
|
||||
@@ -731,9 +728,9 @@ class Derivation
|
||||
$arrayEventExecute = ["BEFORE" => $flagEventExecuteBeforeGateway, "AFTER" => $flagEventExecuteAfterGateway];
|
||||
$positionEventExecute = "BEFORE";
|
||||
|
||||
$aContext = $this->context;
|
||||
$aContext['appUid'] = $applicationData["APP_UID"];
|
||||
$aContext['proUid'] = $applicationData["PRO_UID"];
|
||||
$context = $this->context;
|
||||
$context['appUid'] = $applicationData["APP_UID"];
|
||||
$context['proUid'] = $applicationData["PRO_UID"];
|
||||
if(sizeof($arrayElement)){
|
||||
foreach ($arrayElement as $value) {
|
||||
switch ($value['type']) {
|
||||
@@ -746,24 +743,26 @@ class Derivation
|
||||
//Message-Application throw
|
||||
$result = $messageApplication->create($applicationData["APP_UID"], $applicationData["PRO_UID"], $value['uid'], $applicationData);
|
||||
|
||||
$aContext['envUid'] = $value['uid'];
|
||||
$aContext['envType'] = $event->getEvnType();
|
||||
$aContext['envMarker'] = $event->getEvnMarker();
|
||||
$aContext['action'] = 'Message application throw';
|
||||
$context['envUid'] = $value['uid'];
|
||||
$context['envType'] = $event->getEvnType();
|
||||
$context['envMarker'] = $event->getEvnMarker();
|
||||
$context['action'] = 'Message application throw';
|
||||
//Logger
|
||||
Bootstrap::registerMonolog('CaseDerivation', 200, 'Case Derivation', $aContext, $this->sysSys, 'processmaker.log');
|
||||
$message = 'Case Derivation';
|
||||
Log::channel(':CaseDerivation')->info($message, Bootstrap::context($context));
|
||||
}
|
||||
|
||||
if (preg_match("/^(?:END|INTERMEDIATE)$/", $event->getEvnType()) && $event->getEvnMarker() === 'EMAIL') {
|
||||
//Email-Event throw
|
||||
$result = $emailEvent->sendEmail($applicationData["APP_UID"], $applicationData["PRO_UID"], $value['uid'], $applicationData, $tasId);
|
||||
|
||||
$aContext['envUid'] = $value['uid'];
|
||||
$aContext['envType'] = $event->getEvnType();
|
||||
$aContext['envMarker'] = $event->getEvnMarker();
|
||||
$aContext['action'] = 'Email event throw';
|
||||
$context['envUid'] = $value['uid'];
|
||||
$context['envType'] = $event->getEvnType();
|
||||
$context['envMarker'] = $event->getEvnMarker();
|
||||
$context['action'] = 'Email event throw';
|
||||
//Logger
|
||||
Bootstrap::registerMonolog('CaseDerivation', 200, 'Case Derivation', $aContext, $this->sysSys, 'processmaker.log');
|
||||
$message = 'Case Derivation';
|
||||
Log::channel(':CaseDerivation')->info($message, Bootstrap::context($context));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -845,7 +844,7 @@ class Derivation
|
||||
$nextTasks = $oRoute->mergeDataDerivation($tasks, $aPInformation, $rouType);
|
||||
|
||||
//Get all route types
|
||||
$aRouteTypes = array();
|
||||
$aRouteTypes = [];
|
||||
foreach ($aPInformation as $key => $value) {
|
||||
$aRouteTypes[$key]['ROU_NEXT_TASK'] = $value['ROU_NEXT_TASK'];
|
||||
$aRouteTypes[$key]['ROU_TYPE'] = $value['ROU_TYPE'];
|
||||
@@ -876,8 +875,8 @@ class Derivation
|
||||
function derivate(array $currentDelegation, array $nextDelegations, $removeList = true)
|
||||
{
|
||||
$this->sysSys = (!empty(config("system.workspace")))? config("system.workspace") : "Undefined";
|
||||
$this->context = Bootstrap::getDefaultContextLog();
|
||||
$aContext = $this->context;
|
||||
$this->context = Bootstrap::context();
|
||||
$context = $this->context;
|
||||
$this->removeList = $removeList;
|
||||
$arrayDerivationResult = [];
|
||||
|
||||
@@ -893,8 +892,8 @@ class Derivation
|
||||
|
||||
//Get data for this DEL_INDEX current
|
||||
$appFields = $this->case->loadCase( $currentDelegation['APP_UID'], $currentDelegation['DEL_INDEX'] );
|
||||
$aContext['appUid'] = $currentDelegation['APP_UID'];
|
||||
$aContext['delIndex'] = $currentDelegation['DEL_INDEX'];
|
||||
$context['appUid'] = $currentDelegation['APP_UID'];
|
||||
$context['delIndex'] = $currentDelegation['DEL_INDEX'];
|
||||
|
||||
// Remove the fields that will update with the thread creation
|
||||
unset($appFields['APP_ROUTING_DATA']);
|
||||
@@ -923,7 +922,7 @@ class Derivation
|
||||
$currentDelegation["TAS_MI_COMPLETE_VARIABLE"] = $task->getTasMiCompleteVariable();
|
||||
$currentDelegation["TAS_MI_INSTANCE_VARIABLE"] = $task->getTasMiInstanceVariable();
|
||||
|
||||
$arrayNextDerivation = array();
|
||||
$arrayNextDerivation = [];
|
||||
$flagFirstIteration = true;
|
||||
|
||||
foreach ($nextDelegations as $nextDel) {
|
||||
@@ -965,7 +964,7 @@ class Derivation
|
||||
|
||||
$this->flagUpdateList = true;
|
||||
|
||||
$aContext['tasUid'] = $nextDel['TAS_UID'];
|
||||
$context['tasUid'] = $nextDel['TAS_UID'];
|
||||
switch ($nextDel['TAS_UID']) {
|
||||
case TASK_FINISH_PROCESS:
|
||||
$this->finishProcess(
|
||||
@@ -973,7 +972,7 @@ class Derivation
|
||||
$nextDel,
|
||||
$appFields,
|
||||
$flagFirstIteration,
|
||||
$aContext
|
||||
$context
|
||||
);
|
||||
break;
|
||||
case TASK_FINISH_TASK:
|
||||
@@ -983,7 +982,7 @@ class Derivation
|
||||
$appFields,
|
||||
$flagFirstIteration,
|
||||
$flagTaskAssignTypeIsMultipleInstance,
|
||||
$aContext
|
||||
$context
|
||||
);
|
||||
break;
|
||||
default:
|
||||
@@ -1354,7 +1353,7 @@ class Derivation
|
||||
|
||||
if (isset($aDeriveTasks[1])) {
|
||||
if ($aDeriveTasks[1]['ROU_TYPE'] != 'SELECT') {
|
||||
$nextDelegations2 = array();
|
||||
$nextDelegations2 = [];
|
||||
foreach ($aDeriveTasks as $aDeriveTask) {
|
||||
$nextDelegations2[] = array(
|
||||
'TAS_UID' => $aDeriveTask['NEXT_TASK']['TAS_UID'],
|
||||
@@ -1869,7 +1868,7 @@ class Derivation
|
||||
{
|
||||
try {
|
||||
if ($nextDel['TAS_RECEIVE_LAST_EMAIL'] == 'TRUE') {
|
||||
$taskData = array();
|
||||
$taskData = [];
|
||||
$userLogged = $this->userLogged->load($appFields['APP_DATA']['USER_LOGGED']);
|
||||
$fromName = $userLogged['USR_FIRSTNAME'] . ' ' . $userLogged['USR_LASTNAME'];
|
||||
$sFromData = $fromName . ($userLogged['USR_EMAIL'] != '' ? ' <' . $userLogged['USR_EMAIL'] . '>' : '');
|
||||
@@ -1899,10 +1898,10 @@ class Derivation
|
||||
* @param array $appFields
|
||||
* @param boolean $flagFirstIteration
|
||||
* @param boolean $flagTaskAssignTypeIsMultipleInstance
|
||||
* @param array $aContext
|
||||
* @param array $context
|
||||
* @return void
|
||||
*/
|
||||
public function finishTask($currentDelegation, $nextDel, $appFields, $flagFirstIteration = true, $flagTaskAssignTypeIsMultipleInstance = false, $aContext = array()) {
|
||||
public function finishTask($currentDelegation, $nextDel, $appFields, $flagFirstIteration = true, $flagTaskAssignTypeIsMultipleInstance = false, $context = []) {
|
||||
$iAppThreadIndex = $appFields['DEL_THREAD'];
|
||||
$this->case->closeAppThread($currentDelegation['APP_UID'], $iAppThreadIndex);
|
||||
if (isset($nextDel["TAS_UID_DUMMY"])) {
|
||||
@@ -1940,9 +1939,10 @@ class Derivation
|
||||
);
|
||||
}
|
||||
}
|
||||
$aContext['action'] = 'finish-task';
|
||||
$context['action'] = 'finish-task';
|
||||
//Logger
|
||||
Bootstrap::registerMonolog('CaseDerivation', 200, 'Case Derivation', $aContext, $this->sysSys, 'processmaker.log');
|
||||
$message = 'Case Derivation';
|
||||
Log::channel(':CaseDerivation')->info($message, Bootstrap::context($context));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1952,10 +1952,10 @@ class Derivation
|
||||
* @param array $nextDel
|
||||
* @param array $appFields
|
||||
* @param boolean $flagFirstIteration
|
||||
* @param array $aContext
|
||||
* @param array $context
|
||||
* @return void
|
||||
*/
|
||||
public function finishProcess($currentDelegation, $nextDel, $appFields, $flagFirstIteration = true, $aContext = array()){
|
||||
public function finishProcess($currentDelegation, $nextDel, $appFields, $flagFirstIteration = true, $context = []){
|
||||
/*Close all delegations of $currentDelegation['APP_UID'] */
|
||||
$this->case->closeAllDelegations( $currentDelegation['APP_UID'] );
|
||||
$this->case->closeAllThreads( $currentDelegation['APP_UID'] );
|
||||
@@ -1987,9 +1987,10 @@ class Derivation
|
||||
);
|
||||
}
|
||||
}
|
||||
$aContext['action'] = 'end-process';
|
||||
$context['action'] = 'end-process';
|
||||
//Logger
|
||||
Bootstrap::registerMonolog('CaseDerivation', 200, 'Case Derivation', $aContext, $this->sysSys, 'processmaker.log');
|
||||
$message = 'Case Derivation';
|
||||
Log::channel(':CaseDerivation')->info($message, Bootstrap::context($context));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2003,7 +2004,7 @@ class Derivation
|
||||
*/
|
||||
public function getNextInfoSubProcess($nextDel, $proUid)
|
||||
{
|
||||
$newNextDel = array();
|
||||
$newNextDel = [];
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->add(SubProcessPeer::PRO_PARENT, $proUid);
|
||||
$oCriteria->add(SubProcessPeer::TAS_PARENT, $nextDel['TAS_PARENT']);
|
||||
@@ -2082,7 +2083,7 @@ class Derivation
|
||||
*/
|
||||
public function canRouteTypeSecJoin($flagMultipleInstance, $flagTypeMultipleInstance, $currentDelegation, $appFields, $nextDel)
|
||||
{
|
||||
$arrayOpenThread = ($flagMultipleInstance && $flagTypeMultipleInstance)? $this->case->searchOpenPreviousTasks($currentDelegation["TAS_UID"], $currentDelegation["APP_UID"]) : array();
|
||||
$arrayOpenThread = ($flagMultipleInstance && $flagTypeMultipleInstance)? $this->case->searchOpenPreviousTasks($currentDelegation["TAS_UID"], $currentDelegation["APP_UID"]) : [];
|
||||
|
||||
if (
|
||||
$flagMultipleInstance
|
||||
@@ -2220,7 +2221,7 @@ class Derivation
|
||||
*/
|
||||
public function routePrepareInformationNextTask($currentDelegation, $iNewDelIndex, $nextDel)
|
||||
{
|
||||
$nextDelegationsAux = array();
|
||||
$nextDelegationsAux = [];
|
||||
$taskNextDelNextDelRouType = "";
|
||||
$i = 0;
|
||||
//Get for $nextDel["TAS_UID"] your next Task
|
||||
@@ -2296,7 +2297,7 @@ class Derivation
|
||||
* @param boolean $flagFirstIteration
|
||||
* @return void
|
||||
*/
|
||||
public function doRouteWithoutThread($appFields, $currentDelegation, $nextDel, $arraySiblings = array(), $flagMultipleInstance = false, $flagTypeMultipleInstance = false, $flagFirstIteration = false)
|
||||
public function doRouteWithoutThread($appFields, $currentDelegation, $nextDel, $arraySiblings = [], $flagMultipleInstance = false, $flagTypeMultipleInstance = false, $flagFirstIteration = false)
|
||||
{
|
||||
$iAppThreadIndex = $appFields['DEL_THREAD'];
|
||||
$routeType = $currentDelegation["ROU_TYPE"];
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
use \ProcessMaker\BusinessModel\User;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use ProcessMaker\BusinessModel\User;
|
||||
|
||||
/**
|
||||
* class.ldapAdvanced.php
|
||||
@@ -1127,10 +1128,12 @@ class LdapAdvanced
|
||||
BasePeer::doUpdate($c1, $c2, $con);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$context = Bootstrap::getDefaultContextLog();
|
||||
$context["action"] = "ldapSynchronize";
|
||||
$context["authSource"] = $arrayAuthSource;
|
||||
Bootstrap::registerMonolog("ldapSynchronize", 400, $e->getMessage(), $context, $context["workspace"], "processmaker.log");
|
||||
$context = [
|
||||
"action" => "ldapSynchronize",
|
||||
"authSource" => $arrayAuthSource
|
||||
];
|
||||
$message = $e->getMessage();
|
||||
Log::channel(':ldapSynchronize')->error($message, Bootstrap::context($context));
|
||||
}
|
||||
|
||||
//Check ldap connection for user
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use PhpMyAdmin\SqlParser\Parser;
|
||||
use ProcessMaker\Core\System;
|
||||
use ProcessMaker\BusinessModel\DynaForm\SuggestTrait;
|
||||
@@ -79,7 +80,7 @@ class PmDynaform
|
||||
public function __construct($fields = [])
|
||||
{
|
||||
$this->sysSys = (!empty(config("system.workspace"))) ? config("system.workspace") : "Undefined";
|
||||
$this->context = \Bootstrap::getDefaultContextLog();
|
||||
$this->context = Bootstrap::context();
|
||||
$this->dataSources = array("database", "dataVariable");
|
||||
$this->pathRTLCss = '/lib/pmdynaform/build/css/PMDynaform-rtl.css';
|
||||
$this->serverConf = ServerConf::getSingleton();
|
||||
@@ -939,18 +940,16 @@ class PmDynaform
|
||||
|
||||
$this->context["action"] = "execute-sql" . $type;
|
||||
$this->context["sql"] = $sql;
|
||||
\Bootstrap::registerMonolog("sqlExecution", 200, "Sql Execution", $this->context, $this->sysSys, "processmaker.log");
|
||||
$message = 'Sql Execution';
|
||||
Log::channel(':sqlExecution')->info($message, Bootstrap::context($this->context));
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$this->context["action"] = "execute-sql" . $type;
|
||||
$this->context["exception"] = (array) $e;
|
||||
$this->lastQueryError = $e;
|
||||
\Bootstrap::registerMonolog("sqlExecution",
|
||||
400,
|
||||
"Sql Execution",
|
||||
$this->basicExceptionData($e, $sql),
|
||||
$this->sysSys,
|
||||
"processmaker.log");
|
||||
$message = 'Sql Execution';
|
||||
$context = $this->basicExceptionData($e, $sql);
|
||||
Log::channel(':sqlExecution')->error($message, Bootstrap::context($context));
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
@@ -2396,14 +2395,13 @@ class PmDynaform
|
||||
$jsonData = G::json_encode($json);
|
||||
|
||||
//Log
|
||||
\Bootstrap::registerMonolog(
|
||||
'RenderDynaForm',
|
||||
400,
|
||||
'JSON encoded string error ' . $jsonLastError . ': ' . $jsonLastErrorMsg,
|
||||
['token' => $token, 'projectUid' => $this->record['PRO_UID'], 'dynaFormUid' => $this->record['DYN_UID']],
|
||||
config("system.workspace"),
|
||||
'processmaker.log'
|
||||
);
|
||||
$message = 'JSON encoded string error ' . $jsonLastError . ': ' . $jsonLastErrorMsg;
|
||||
$context = [
|
||||
'token' => $token,
|
||||
'projectUid' => $this->record['PRO_UID'],
|
||||
'dynaFormUid' => $this->record['DYN_UID']
|
||||
];
|
||||
Log::channel(':RenderDynaForm')->error($message, Bootstrap::context($context));
|
||||
}
|
||||
|
||||
//Return
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use ProcessMaker\BusinessModel\EmailEvent;
|
||||
use ProcessMaker\BusinessModel\Variable as BmVariable;
|
||||
use ProcessMaker\Core\System;
|
||||
@@ -4491,7 +4492,8 @@ class Processes
|
||||
try {
|
||||
$result = $scriptTask->create($processUid, $record);
|
||||
} catch (Exception $e) {
|
||||
Bootstrap::registerMonolog('DataError', 400, $e->getMessage(), $record, config("system.workspace"), 'processmaker.log');
|
||||
$message = $e->getMessage();
|
||||
Log::channel(':DataError')->error($message, Bootstrap::context($record));
|
||||
}
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
@@ -5406,16 +5408,14 @@ class Processes
|
||||
}
|
||||
if ($bytesSaved != $fsContent) {
|
||||
$channel = "writingMailTemplate";
|
||||
$context = \Bootstrap::getDefaultContextLog();
|
||||
$context = [];
|
||||
$context['action'] = $channel;
|
||||
if (defined("SYS_CURRENT_URI") && defined("SYS_CURRENT_PARMS")) {
|
||||
$context['url'] = SYS_CURRENT_URI . '?' . SYS_CURRENT_PARMS;
|
||||
}
|
||||
$context['usrUid'] = isset($_SESSION['USER_LOGGED']) ? $_SESSION['USER_LOGGED'] : '';
|
||||
$sysSys = !empty(config("system.workspace")) ? config("system.workspace") : "Undefined";
|
||||
$message = 'The imported template has a number of byes different than the original template, please verify if the file \'' . $newFileName . '\' is correct.';
|
||||
$level = 400;
|
||||
Bootstrap::registerMonolog($channel, $level, $message, $context, $sysSys, 'processmaker.log');
|
||||
Log::channel(':' . $channel)->error($message, Bootstrap::context($context));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
use App\Jobs\GenerateReportTable;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use ProcessMaker\Core\JobsManager;
|
||||
use ProcessMaker\Model\Application;
|
||||
|
||||
@@ -614,14 +615,12 @@ class ReportTables
|
||||
try {
|
||||
$rs = $stmt->executeQuery($sQuery);
|
||||
} catch (Exception $e) {
|
||||
Bootstrap::registerMonolog(
|
||||
'sqlExecution',
|
||||
400,
|
||||
'Sql Execution',
|
||||
['sql' => $sQuery, 'error' => $e->getMessage()],
|
||||
config("system.workspace"),
|
||||
'processmaker.log'
|
||||
);
|
||||
$message = 'Sql Execution';
|
||||
$context = [
|
||||
'sql' => $sQuery,
|
||||
'error' => $e->getMessage()
|
||||
];
|
||||
Log::channel(':sqlExecution')->error($message, Bootstrap::context($context));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -666,14 +665,12 @@ class ReportTables
|
||||
try {
|
||||
$rs = $stmt->executeQuery($sQuery);
|
||||
} catch (Exception $e) {
|
||||
Bootstrap::registerMonolog(
|
||||
'sqlExecution',
|
||||
400,
|
||||
'Sql Execution',
|
||||
['sql' => $sQuery, 'error' => $e->getMessage()],
|
||||
config("system.workspace"),
|
||||
'processmaker.log'
|
||||
);
|
||||
$message = 'Sql Execution';
|
||||
$context = [
|
||||
'sql' => $sQuery,
|
||||
'error' => $e->getMessage()
|
||||
];
|
||||
Log::channel(':sqlExecution')->error($message, Bootstrap::context($context));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -1,13 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* spoolRun - brief send email from the spool database, and see if we have all the addresses we send to.
|
||||
*
|
||||
* @author Ian K Armstrong <ika@[REMOVE_THESE_CAPITALS]openmail.cc>
|
||||
* @copyright Copyright (c) 2007, Ian K Armstrong
|
||||
* @license http://www.opensource.org/licenses/gpl-3.0.html GNU Public License
|
||||
* @link http://www.openmail.cc
|
||||
*/
|
||||
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use ProcessMaker\Core\System;
|
||||
|
||||
/**
|
||||
@@ -365,11 +358,13 @@ class SpoolRun
|
||||
$appMessage->setAppMsgSendDate(date('Y-m-d H:i:s'));
|
||||
$appMessage->save();
|
||||
|
||||
$context = Bootstrap::getDefaultContextLog();
|
||||
$context["action"] = "Send email";
|
||||
$context["appMsgUid"] = $this->getAppMsgUid();
|
||||
$context["appUid"] = $this->getAppUid();
|
||||
Bootstrap::registerMonolog("SendEmail", 400, $msgError, $context);
|
||||
$message = $msgError;
|
||||
$context = [
|
||||
"action" => "Send email",
|
||||
"appMsgUid" => $this->getAppMsgUid(),
|
||||
"appUid" => $this->getAppUid()
|
||||
];
|
||||
Log::channel(':SendEmail')->error($message, Bootstrap::context($context));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
use Illuminate\Database\QueryException;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use ProcessMaker\BusinessModel\Process as BmProcess;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
use ProcessMaker\ChangeLog\ChangeLog;
|
||||
@@ -4934,7 +4935,7 @@ class WorkspaceTools
|
||||
}
|
||||
}
|
||||
|
||||
$context = Bootstrap::getDefaultContextLog();
|
||||
$context = Bootstrap::context();
|
||||
$case = new Cases();
|
||||
|
||||
//select cases for this Process, ordered by APP_NUMBER
|
||||
@@ -5002,7 +5003,8 @@ class WorkspaceTools
|
||||
$context["message"] = $e->getMessage();
|
||||
$context["tableName"] = $tableName;
|
||||
$context["appUid"] = $application->APP_UID;
|
||||
Bootstrap::registerMonolog("sqlExecution", 500, "Sql Execution", $context, $context["workspace"], "processmaker.log");
|
||||
$message = 'Sql Execution';
|
||||
Log::channel(':sqlExecution')->critical($message, Bootstrap::context($context));
|
||||
}
|
||||
unset($obj);
|
||||
}
|
||||
@@ -5020,7 +5022,8 @@ class WorkspaceTools
|
||||
$context["message"] = $e->getMessage();
|
||||
$context["tableName"] = $tableName;
|
||||
$context["appUid"] = $application->APP_UID;
|
||||
Bootstrap::registerMonolog("sqlExecution", 500, "Sql Execution", $context, $context["workspace"], "processmaker.log");
|
||||
$message = 'Sql Execution';
|
||||
Log::channel(':sqlExecution')->critical($message, Bootstrap::context($context));
|
||||
}
|
||||
unset($obj);
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
//
|
||||
// License: LGPL, see LICENSE
|
||||
////////////////////////////////////////////////////
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use ProcessMaker\BusinessModel\Cases as BusinessModelCases;
|
||||
use ProcessMaker\Core\System;
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
@@ -242,9 +243,6 @@ function literalDate ($date, $lang = 'en')
|
||||
*/
|
||||
function executeQuery ($SqlStatement, $DBConnectionUID = 'workflow', $aParameter = array())
|
||||
{
|
||||
$sysSys = (!empty(config("system.workspace")))? config("system.workspace") : "Undefined";
|
||||
$aContext = \Bootstrap::getDefaultContextLog();
|
||||
|
||||
// This means the DBConnectionUID is not loaded yet, so we'll force DbConnections::loadAdditionalConnections
|
||||
if (is_null(config('database.connections.' . $DBConnectionUID . '.driver'))) {
|
||||
// Force to load the external connections
|
||||
@@ -355,17 +353,21 @@ function executeQuery ($SqlStatement, $DBConnectionUID = 'workflow', $aParameter
|
||||
}
|
||||
}
|
||||
//Logger
|
||||
$aContext['action'] = 'execute-query';
|
||||
$aContext['sql'] = $SqlStatement;
|
||||
\Bootstrap::registerMonolog('sqlExecution', 200, 'Sql Execution', $aContext, $sysSys, 'processmaker.log');
|
||||
|
||||
$message = 'Sql Execution';
|
||||
$context = [
|
||||
'action' => 'execute-query',
|
||||
'sql' => $SqlStatement
|
||||
];
|
||||
Log::channel(':sqlExecution')->info($message, Bootstrap::context($context));
|
||||
return $result;
|
||||
} catch (SQLException $sqle) {
|
||||
//Logger
|
||||
$aContext['action'] = 'execute-query';
|
||||
$aContext['SQLExceptionMessage'] = $sqle->getMessage();
|
||||
\Bootstrap::registerMonolog('sqlExecution', 400, 'Sql Execution', $aContext, $sysSys, 'processmaker.log');
|
||||
|
||||
$message = 'Sql Execution';
|
||||
$context = [
|
||||
'action' => 'execute-query',
|
||||
'SQLExceptionMessage' => $sqle->getMessage()
|
||||
];
|
||||
Log::channel(':sqlExecution')->error($message, Bootstrap::context($context));
|
||||
$con->rollback();
|
||||
throw $sqle;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
@@ -1067,10 +1068,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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use ProcessMaker\Core\System;
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
@@ -264,7 +265,9 @@ class Designer extends Controller
|
||||
}
|
||||
Tracker::authentication($_SESSION['CASE'], $_SESSION['PIN']);
|
||||
} catch (\Exception $e) {
|
||||
Bootstrap::registerMonolog('CaseTracker', 400, $e->getMessage(), [], config("system.workspace"), 'processmaker.log');
|
||||
$message = $e->getMessage();
|
||||
$context = [];
|
||||
Log::channel(':CaseTracker')->error($message, Bootstrap::context($context));
|
||||
\G::header('Location: /errors/error403.php');
|
||||
die();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use ProcessMaker\Core\System;
|
||||
use ProcessMaker\Model\AdditionalTables as AdditionalTablesModel;
|
||||
use ProcessMaker\Validation\ExceptionRestApi;
|
||||
@@ -1221,11 +1222,13 @@ class pmTablesProxy extends HttpProxyController
|
||||
$additionalTables->populateReportTable($table['ADD_TAB_NAME'], PmTable::resolveDbSource($table['DBS_UID']), $table['ADD_TAB_TYPE'], $table['PRO_UID'], $table['ADD_TAB_GRID'], $table['ADD_TAB_UID']);
|
||||
$result->message = G::LoadTranslation("ID_THE_REPORT_TABLE_IS_REGENERATING_PLEASE_COME_BACK_IN_A_FEW_MINUTES");
|
||||
} catch (Exception $e) {
|
||||
$context = Bootstrap::getDefaultContextLog();
|
||||
$context['proUid'] = $table['PRO_UID'];
|
||||
$context['tableName'] = $table['ADD_TAB_NAME'];
|
||||
$context['message'] = $e->getMessage();
|
||||
Bootstrap::registerMonolog('dataReport', 500, 'Generation of data report could not be completed', $context, $context['workspace'], 'processmaker.log');
|
||||
$message = 'Generation of data report could not be completed';
|
||||
$context = [
|
||||
'proUid' => $table['PRO_UID'],
|
||||
'tableName' => $table['ADD_TAB_NAME'],
|
||||
'message' => $e->getMessage()
|
||||
];
|
||||
Log::channel(':dataReport')->critical($message, Bootstrap::context($context));
|
||||
|
||||
$result->message = 'Generation of data report could not be completed. Please check the processmaker.log for more details.';
|
||||
$result->success = false;
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class ldapadvancedClassCron
|
||||
{
|
||||
public $deletedRemoved = 0; //Users in the removed OU
|
||||
@@ -360,10 +363,12 @@ class ldapadvancedClassCron
|
||||
//Update Users data based on the LDAP Server
|
||||
$plugin->usersUpdateData($arrayAuthenticationSourceData["AUTH_SOURCE_UID"]);
|
||||
} catch (Exception $e) {
|
||||
$context = Bootstrap::getDefaultContextLog();
|
||||
$context["action"] = "ldapSynchronize";
|
||||
$context["authSource"] = $arrayAuthenticationSourceData;
|
||||
Bootstrap::registerMonolog("ldapSynchronize", 400, $e->getMessage(), $context, $context["workspace"], "processmaker.log");
|
||||
$message = $e->getMessage();
|
||||
$context = [
|
||||
'action' => 'ldapSynchronize',
|
||||
'authSource' => $arrayAuthenticationSourceData
|
||||
];
|
||||
Log::channel(':ldapSynchronize')->error($message, Bootstrap::context($context));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ use Bootstrap;
|
||||
use Configurations;
|
||||
use Exception;
|
||||
use G;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use ProcessMaker\Core\System;
|
||||
use Symfony\Component\Finder\Finder;
|
||||
|
||||
@@ -273,7 +274,7 @@ class AuditLog
|
||||
foreach ($lines as $line) {
|
||||
if ($start <= $count && count($result) < $limit) {
|
||||
/**
|
||||
* processmaker/gulliver/system/class.monologProvider.php
|
||||
* \App\Logging\CustomizeFormatter
|
||||
* "<%level%> %datetime% %channel% %level_name%: %message% %context% %extra%\n"
|
||||
*/
|
||||
$data = $this->lineToObject($line, '/([A-Z][a-z][a-z]\s{1,2}\d{1,2}\s\d{2}[:]\d{2}[:]\d{2})\s([\w][\w\d\.@-]*)\s(.*)$/');
|
||||
@@ -288,30 +289,6 @@ class AuditLog
|
||||
return [$count, $result];
|
||||
}
|
||||
|
||||
/**
|
||||
* Register an action for Audit Log.
|
||||
*
|
||||
* @param string $action
|
||||
* @param string $value
|
||||
*/
|
||||
public function register($action, $value = '')
|
||||
{
|
||||
$context = Bootstrap::getDefaultContextLog();
|
||||
$context['usrUid'] = $this->userLogged;
|
||||
$context['usrName'] = $this->userFullname;
|
||||
$context['action'] = $action;
|
||||
$context['description'] = $value;
|
||||
Bootstrap::registerMonolog(
|
||||
$action,
|
||||
200,
|
||||
$action,
|
||||
$context,
|
||||
$context['workspace'],
|
||||
'audit.log',
|
||||
self::READ_LOGGING_LEVEL
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Audit Log files.
|
||||
*
|
||||
|
||||
@@ -14,6 +14,7 @@ use EmailServerPeer;
|
||||
use Exception;
|
||||
use G;
|
||||
use Illuminate\Support\Facades\Crypt;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use PhpImap\IncomingMail;
|
||||
use PhpImap\Mailbox;
|
||||
use PMLicensedFeatures;
|
||||
@@ -73,14 +74,34 @@ class ResponseReader
|
||||
}
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
Bootstrap::registerMonolog(
|
||||
$this->channel,
|
||||
$e->getCode() != 0 ? $e->getCode() : 300,
|
||||
$e->getMessage(),
|
||||
$this->case,
|
||||
config("system.workspace"),
|
||||
'processmaker.log'
|
||||
);
|
||||
$message = $e->getMessage();
|
||||
$context = $this->case;
|
||||
switch ($e->getCode()) {
|
||||
case 100:
|
||||
Log::channel(':' . $this->channel)->debug($message, Bootstrap::context($context));
|
||||
break;
|
||||
case 200:
|
||||
Log::channel(':' . $this->channel)->info($message, Bootstrap::context($context));
|
||||
break;
|
||||
case 250:
|
||||
Log::channel(':' . $this->channel)->notice($message, Bootstrap::context($context));
|
||||
break;
|
||||
default://300
|
||||
Log::channel(':' . $this->channel)->warning($message, Bootstrap::context($context));
|
||||
break;
|
||||
case 400:
|
||||
Log::channel(':' . $this->channel)->error($message, Bootstrap::context($context));
|
||||
break;
|
||||
case 500:
|
||||
Log::channel(':' . $this->channel)->critical($message, Bootstrap::context($context));
|
||||
break;
|
||||
case 550:
|
||||
Log::channel(':' . $this->channel)->alert($message, Bootstrap::context($context));
|
||||
break;
|
||||
case 600:
|
||||
Log::channel(':' . $this->channel)->emergency($message, Bootstrap::context($context));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,14 +159,9 @@ class ResponseReader
|
||||
try {
|
||||
$dataEmail = G::json_decode(Crypt::decryptString($matches[1]), true);
|
||||
} catch (Exception $e) {
|
||||
Bootstrap::registerMonolog(
|
||||
$this->channel,
|
||||
300,
|
||||
G::LoadTranslation('ID_ABE_RESPONSE_CANNOT_BE_IDENTIFIED'),
|
||||
[],
|
||||
config("system.workspace"),
|
||||
'processmaker.log'
|
||||
);
|
||||
$message = G::LoadTranslation('ID_ABE_RESPONSE_CANNOT_BE_IDENTIFIED');
|
||||
$context = [];
|
||||
Log::channel(':' . $this->channel)->warning($message, Bootstrap::context($context));
|
||||
$mailbox->markMailAsRead($mailId);
|
||||
continue;
|
||||
}
|
||||
@@ -162,14 +178,9 @@ class ResponseReader
|
||||
throw (new Exception(G::LoadTranslation('ID_CASE_DELEGATION_ALREADY_CLOSED'), 400));
|
||||
}
|
||||
$this->processABE($this->case, $mail, $dataAbe);
|
||||
Bootstrap::registerMonolog(
|
||||
$this->channel,
|
||||
100, // DEBUG
|
||||
G::LoadTranslation('ID_ABE_LOG_PROCESSED_OK'),
|
||||
$this->case,
|
||||
config("system.workspace"),
|
||||
'processmaker.log'
|
||||
);
|
||||
$message = G::LoadTranslation('ID_ABE_LOG_PROCESSED_OK');
|
||||
$context = $this->case;
|
||||
Log::channel(':' . $this->channel)->debug($message, Bootstrap::context($context));
|
||||
} catch (Exception $e) {
|
||||
$this->sendMessageError(
|
||||
$this->getMessageResponseError() ? $this->getMessageResponseError() : $e->getMessage(),
|
||||
@@ -177,14 +188,34 @@ class ResponseReader
|
||||
$mail,
|
||||
$emailSetup
|
||||
);
|
||||
Bootstrap::registerMonolog(
|
||||
$this->channel,
|
||||
$e->getCode() != 0 ? $e->getCode() : 400,
|
||||
$e->getMessage(),
|
||||
$this->case,
|
||||
config("system.workspace"),
|
||||
'processmaker.log'
|
||||
);
|
||||
$message = $e->getMessage();
|
||||
$context = $this->case;
|
||||
switch ($e->getCode()) {
|
||||
case 100:
|
||||
Log::channel(':' . $this->channel)->debug($message, Bootstrap::context($context));
|
||||
break;
|
||||
case 200:
|
||||
Log::channel(':' . $this->channel)->info($message, Bootstrap::context($context));
|
||||
break;
|
||||
case 250:
|
||||
Log::channel(':' . $this->channel)->notice($message, Bootstrap::context($context));
|
||||
break;
|
||||
case 300:
|
||||
Log::channel(':' . $this->channel)->warning($message, Bootstrap::context($context));
|
||||
break;
|
||||
default://400
|
||||
Log::channel(':' . $this->channel)->error($message, Bootstrap::context($context));
|
||||
break;
|
||||
case 500:
|
||||
Log::channel(':' . $this->channel)->critical($message, Bootstrap::context($context));
|
||||
break;
|
||||
case 550:
|
||||
Log::channel(':' . $this->channel)->alert($message, Bootstrap::context($context));
|
||||
break;
|
||||
case 600:
|
||||
Log::channel(':' . $this->channel)->emergency($message, Bootstrap::context($context));
|
||||
break;
|
||||
}
|
||||
}
|
||||
$mailbox->markMailAsRead($mailId);
|
||||
}
|
||||
@@ -193,14 +224,34 @@ class ResponseReader
|
||||
}
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
Bootstrap::registerMonolog(
|
||||
$this->channel,
|
||||
$e->getCode() != 0 ? $e->getCode() : 500,
|
||||
$e->getMessage(),
|
||||
$this->case,
|
||||
config("system.workspace"),
|
||||
'processmaker.log'
|
||||
);
|
||||
$message = $e->getMessage();
|
||||
$context = $this->case;
|
||||
switch ($e->getCode()) {
|
||||
case 100:
|
||||
Log::channel(':' . $this->channel)->debug($message, Bootstrap::context($context));
|
||||
break;
|
||||
case 200:
|
||||
Log::channel(':' . $this->channel)->info($message, Bootstrap::context($context));
|
||||
break;
|
||||
case 250:
|
||||
Log::channel(':' . $this->channel)->notice($message, Bootstrap::context($context));
|
||||
break;
|
||||
case 300:
|
||||
Log::channel(':' . $this->channel)->warning($message, Bootstrap::context($context));
|
||||
break;
|
||||
case 400:
|
||||
Log::channel(':' . $this->channel)->error($message, Bootstrap::context($context));
|
||||
break;
|
||||
default://500
|
||||
Log::channel(':' . $this->channel)->critical($message, Bootstrap::context($context));
|
||||
break;
|
||||
case 550:
|
||||
Log::channel(':' . $this->channel)->alert($message, Bootstrap::context($context));
|
||||
break;
|
||||
case 600:
|
||||
Log::channel(':' . $this->channel)->emergency($message, Bootstrap::context($context));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -249,14 +300,9 @@ class ResponseReader
|
||||
$abeAbeResponsesInstance = new AbeResponses();
|
||||
$dataResponses['ABE_RES_UID'] = $abeAbeResponsesInstance->createOrUpdate($dataResponses);
|
||||
} catch (Exception $e) {
|
||||
Bootstrap::registerMonolog(
|
||||
$this->channel,
|
||||
300,
|
||||
$e->getMessage(),
|
||||
$this->case,
|
||||
config("system.workspace"),
|
||||
'processmaker.log'
|
||||
);
|
||||
$message = $e->getMessage();
|
||||
$context = $this->case;
|
||||
Log::channel(':' . $this->channel)->warning($message, Bootstrap::context($context));
|
||||
}
|
||||
|
||||
ChangeLog::getChangeLog()
|
||||
@@ -297,14 +343,9 @@ class ResponseReader
|
||||
$abeAbeResponsesInstance = new AbeResponses();
|
||||
$abeAbeResponsesInstance->createOrUpdate($dataResponses);
|
||||
} catch (Exception $e) {
|
||||
Bootstrap::registerMonolog(
|
||||
$this->channel,
|
||||
300,
|
||||
$e->getMessage(),
|
||||
$this->case,
|
||||
config("system.workspace"),
|
||||
'processmaker.log'
|
||||
);
|
||||
$message = $e->getMessage();
|
||||
$context = $this->case;
|
||||
Log::channel(':' . $this->channel)->warning($message, Bootstrap::context($context));
|
||||
}
|
||||
$dataAbeRequests = loadAbeRequest($caseInfo['ABE_REQ_UID']);
|
||||
//Save Cases Notes
|
||||
|
||||
@@ -31,9 +31,9 @@ use Exception;
|
||||
use G;
|
||||
use Groups;
|
||||
use GroupUserPeer;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use InputDocument;
|
||||
use InvalidIndexSearchTextException;
|
||||
use ListParticipatedLast;
|
||||
use PmDynaform;
|
||||
use PmTable;
|
||||
use ProcessMaker\BusinessModel\ProcessSupervisor as BmProcessSupervisor;
|
||||
@@ -3311,7 +3311,9 @@ class Cases
|
||||
}
|
||||
$arrayApplicationData['APP_DATA'][$key] = G::json_encode($files);
|
||||
} catch (Exception $e) {
|
||||
Bootstrap::registerMonolog('DeleteFile', 400, $e->getMessage(), $value, config("system.workspace"), 'processmaker.log');
|
||||
$message = $e->getMessage();
|
||||
$context = $value;
|
||||
Log::channel(':DeleteFile')->error($message, Bootstrap::context($context));
|
||||
}
|
||||
}
|
||||
$flagDelete = true;
|
||||
@@ -4064,8 +4066,12 @@ class Cases
|
||||
->status(415)
|
||||
->message(G::LoadTranslation('ID_UPLOAD_INVALID_DOC_TYPE_FILE', [$inpDocTypeFile]))
|
||||
->log(function ($rule) {
|
||||
Bootstrap::registerMonologPhpUploadExecution('phpUpload', 250, $rule->getMessage(),
|
||||
$rule->getData()->filename);
|
||||
$message = $rule->getMessage();
|
||||
$context = [
|
||||
'filename' => $rule->getData()->filename,
|
||||
'url' => $_SERVER["REQUEST_URI"] ?? ''
|
||||
];
|
||||
Log::channel(':phpUpload')->notice($message, Bootstrap::context($context));
|
||||
});
|
||||
// Rule: maximum file size
|
||||
$validator->addRule()
|
||||
@@ -4084,8 +4090,12 @@ class Cases
|
||||
->message(G::LoadTranslation("ID_UPLOAD_INVALID_DOC_MAX_FILESIZE",
|
||||
[$inpDocMaxFileSize . $inpDocMaxFileSizeUnit]))
|
||||
->log(function ($rule) {
|
||||
Bootstrap::registerMonologPhpUploadExecution('phpUpload', 250, $rule->getMessage(),
|
||||
$rule->getData()->filename);
|
||||
$message = $rule->getMessage();
|
||||
$context = [
|
||||
'filename' => $rule->getData()->filename,
|
||||
'url' => $_SERVER["REQUEST_URI"] ?? ''
|
||||
];
|
||||
Log::channel(':phpUpload')->notice($message, Bootstrap::context($context));
|
||||
});
|
||||
$validator->validate();
|
||||
// We will to review if the validator has some error
|
||||
|
||||
@@ -10,6 +10,7 @@ use EmailEventPeer;
|
||||
use EmailServerPeer;
|
||||
use Exception;
|
||||
use G;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use ProcessMaker\Util\Common;
|
||||
use Propel;
|
||||
use ResultSet;
|
||||
@@ -533,13 +534,12 @@ class EmailEvent
|
||||
WsBase::MESSAGE_TYPE_EMAIL_EVENT
|
||||
);
|
||||
} else {
|
||||
Bootstrap::registerMonolog(
|
||||
'EmailEventMailError',
|
||||
200,
|
||||
G::LoadTranslation('ID_EMAIL_EVENT_CONFIGURATION_EMAIL', [$eventUid, $prj_uid]),
|
||||
['eventUid' => $eventUid, 'prj_uid' => $prj_uid],
|
||||
config('system.workspace'),
|
||||
'processmaker.log');
|
||||
$message = G::LoadTranslation('ID_EMAIL_EVENT_CONFIGURATION_EMAIL', [$eventUid, $prj_uid]);
|
||||
$context = [
|
||||
'eventUid' => $eventUid,
|
||||
'prj_uid' => $prj_uid
|
||||
];
|
||||
Log::channel(':EmailEventMailError')->info($message, Bootstrap::context($context));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace ProcessMaker\BusinessModel;
|
||||
|
||||
use AppMessage;
|
||||
@@ -6,6 +7,7 @@ use Bootstrap;
|
||||
use Exception;
|
||||
use G;
|
||||
use Illuminate\Support\Facades\Crypt;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use ProcessMaker\Core\System;
|
||||
use ProcessMaker\Model\AbeConfiguration;
|
||||
use ProcessMaker\Model\EmailEvent;
|
||||
@@ -856,12 +858,9 @@ class EmailServer
|
||||
'setAsDefaultConfiguration' => $arrayData["MESS_DEFAULT"]
|
||||
);
|
||||
$this->setContextLog($info);
|
||||
$this->syslog(
|
||||
'CreateEmailServer',
|
||||
200,
|
||||
'New email server was created',
|
||||
$this->getContextLog()
|
||||
);
|
||||
$message = 'New email server was created';
|
||||
$context = $this->getContextLog();
|
||||
Log::channel(':CreateEmailServer')->info($message, Bootstrap::context($context));
|
||||
return $this->getEmailServer($emailServerUid);
|
||||
} else {
|
||||
$msg = "";
|
||||
@@ -1036,13 +1035,9 @@ class EmailServer
|
||||
'setAsDefaultConfiguration' => $arrayData["MESS_DEFAULT"]
|
||||
);
|
||||
$this->setContextLog($info);
|
||||
$this->syslog(
|
||||
'UpdateEmailServer',
|
||||
200,
|
||||
'The email server was updated',
|
||||
$this->getContextLog()
|
||||
);
|
||||
|
||||
$message = 'The email server was updated';
|
||||
$context = $this->getContextLog();
|
||||
Log::channel(':UpdateEmailServer')->info($message, Bootstrap::context($context));
|
||||
return $arrayData;
|
||||
} else {
|
||||
$msg = "";
|
||||
@@ -1105,12 +1100,9 @@ class EmailServer
|
||||
'messUid' => $emailServerUid
|
||||
);
|
||||
$this->setContextLog($info);
|
||||
$this->syslog(
|
||||
'DeleteEmailServer',
|
||||
200,
|
||||
'The email server was deleted',
|
||||
$this->getContextLog()
|
||||
);
|
||||
$message = 'The email server was deleted';
|
||||
$context = $this->getContextLog();
|
||||
Log::channel(':DeleteEmailServer')->info($message, Bootstrap::context($context));
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
@@ -1419,31 +1411,5 @@ class EmailServer
|
||||
return $rsCriteria->getRow();
|
||||
}
|
||||
|
||||
/**
|
||||
* Logging information related to the email server
|
||||
* When the user create, update, delete the email server
|
||||
*
|
||||
* @param string $channel
|
||||
* @param string $level
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
*
|
||||
* @return void
|
||||
* @throws Exception
|
||||
*/
|
||||
private function syslog(
|
||||
$channel,
|
||||
$level,
|
||||
$message,
|
||||
$context = array()
|
||||
)
|
||||
{
|
||||
try {
|
||||
Bootstrap::registerMonolog($channel, $level, $message, $context, $context['workspace'], 'processmaker.log');
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ use database;
|
||||
use Exception;
|
||||
use G;
|
||||
use GulliverBasePeer;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use InputDocument;
|
||||
use PmLicenseManager;
|
||||
use PMmemcached;
|
||||
@@ -348,9 +349,12 @@ class Light
|
||||
$response['caseNumber'] = $aData['CASE_NUMBER'];
|
||||
|
||||
//Log
|
||||
Bootstrap::registerMonolog('MobileCreateCase', 200, "Create case",
|
||||
['application_uid' => $aData['APPLICATION'], 'usr_uid' => $userId], config("system.workspace"),
|
||||
'processmaker.log');
|
||||
$message = 'Create case';
|
||||
$context = [
|
||||
'application_uid' => $aData['APPLICATION'],
|
||||
'usr_uid' => $userId
|
||||
];
|
||||
Log::channel(':MobileCreateCase')->info($message, Bootstrap::context($context));
|
||||
} catch (Exception $e) {
|
||||
$response['status'] = 'failure';
|
||||
$response['message'] = $e->getMessage();
|
||||
@@ -624,9 +628,12 @@ class Light
|
||||
}
|
||||
|
||||
//Log
|
||||
Bootstrap::registerMonolog('MobileRouteCase', 200, 'Route case',
|
||||
['application_uid' => $applicationUid, 'usr_uid' => $userUid], config("system.workspace"),
|
||||
'processmaker.log');
|
||||
$message = 'Route case';
|
||||
$context = [
|
||||
'application_uid' => $applicationUid,
|
||||
'usr_uid' => $userUid
|
||||
];
|
||||
Log::channel(':MobileRouteCase')->info($message, Bootstrap::context($context));
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
@@ -1128,7 +1135,12 @@ class Light
|
||||
->status(415)
|
||||
->message(G::LoadTranslation('ID_UPLOAD_INVALID_DOC_TYPE_FILE', [$inpDocTypeFile]))
|
||||
->log(function($rule) {
|
||||
Bootstrap::registerMonologPhpUploadExecution('phpUpload', 250, $rule->getMessage(), $rule->getData()->filename);
|
||||
$message = $rule->getMessage();
|
||||
$context = [
|
||||
'filename' => $rule->getData()->filename,
|
||||
'url' => $_SERVER["REQUEST_URI"] ?? ''
|
||||
];
|
||||
Log::channel(':phpUpload')->notice($message, Bootstrap::context($context));
|
||||
});
|
||||
|
||||
//rule: maximum file size
|
||||
@@ -1146,7 +1158,12 @@ class Light
|
||||
->status(413)
|
||||
->message(G::LoadTranslation("ID_UPLOAD_INVALID_DOC_MAX_FILESIZE", [$inpDocMaxFilesize . $inpDocMaxFilesizeUnit]))
|
||||
->log(function($rule) {
|
||||
Bootstrap::registerMonologPhpUploadExecution('phpUpload', 250, $rule->getMessage(), $rule->getData()->filename);
|
||||
$message = $rule->getMessage();
|
||||
$context = [
|
||||
'filename' => $rule->getData()->filename,
|
||||
'url' => $_SERVER["REQUEST_URI"] ?? ''
|
||||
];
|
||||
Log::channel(':phpUpload')->notice($message, Bootstrap::context($context));
|
||||
});
|
||||
$validator->validate();
|
||||
if ($validator->fails()) {
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace ProcessMaker\BusinessModel;
|
||||
|
||||
use Bootstrap;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class MessageApplication
|
||||
{
|
||||
private $arrayFieldNameForException = array(
|
||||
@@ -446,12 +450,9 @@ class MessageApplication
|
||||
,'evnUid' => $value['EVN_UID']
|
||||
,'evnName' => $value['EVN_NAME']
|
||||
);
|
||||
$this->syslog(
|
||||
200
|
||||
,"Case #$appNumber created"
|
||||
,'CREATED-NEW-CASE'
|
||||
,$aInfo
|
||||
);
|
||||
$message = "Case #$appNumber created";
|
||||
$context = $aInfo;
|
||||
Log::channel(':MessageEventCron')->info($message, Bootstrap::context($context));
|
||||
|
||||
$result = $ws->derivateCase($messageEventDefinitionUserUid, $applicationUid, 1);
|
||||
$arrayResult = \G::json_decode(\G::json_encode($result), true);
|
||||
@@ -469,12 +470,9 @@ class MessageApplication
|
||||
,'evnUid' => $value['EVN_UID']
|
||||
,'evnName' => $value['EVN_NAME']
|
||||
);
|
||||
$this->syslog(
|
||||
200
|
||||
,"Case #$appNumber routed"
|
||||
,'ROUTED-NEW-CASE'
|
||||
,$aInfo
|
||||
);
|
||||
$message = "Case #$appNumber routed";
|
||||
$context = $aInfo;
|
||||
Log::channel(':MessageEventCron')->info($message, Bootstrap::context($context));
|
||||
} else {
|
||||
$aInfo = array(
|
||||
'ip' => \G::getIpAddress()
|
||||
@@ -488,12 +486,9 @@ class MessageApplication
|
||||
,'evnUid' => $value['EVN_UID']
|
||||
,'evnName' => $value['EVN_NAME']
|
||||
);
|
||||
$this->syslog(
|
||||
500
|
||||
,"Failed case #$appNumber. " . $arrayResult["message"]
|
||||
,'ROUTED-NEW-CASE'
|
||||
,$aInfo
|
||||
);
|
||||
$message = "Failed case #$appNumber. " . $arrayResult["message"];
|
||||
$context = $aInfo;
|
||||
Log::channel(':MessageEventCron')->critical($message, Bootstrap::context($context));
|
||||
}
|
||||
|
||||
$flagCatched = true;
|
||||
@@ -511,12 +506,9 @@ class MessageApplication
|
||||
,'evnUid' => $value['EVN_UID']
|
||||
,'evnName' => $value['EVN_NAME']
|
||||
);
|
||||
$this->syslog(
|
||||
500
|
||||
,"Failed case #$appNumber. " . $arrayResult["message"]
|
||||
,'CREATED-NEW-CASE'
|
||||
,$aInfo
|
||||
);
|
||||
$message = "Failed case #$appNumber. " . $arrayResult["message"];
|
||||
$context = $aInfo;
|
||||
Log::channel(':MessageEventCron')->critical($message, Bootstrap::context($context));
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -567,12 +559,9 @@ class MessageApplication
|
||||
,'evnUid' => $value['EVN_UID']
|
||||
,'evnName' => $value['EVN_NAME']
|
||||
);
|
||||
$this->syslog(
|
||||
200
|
||||
,"Case #$appNumber routed "
|
||||
,'ROUTED-NEW-CASE'
|
||||
,$aInfo
|
||||
);
|
||||
$message = "Case #$appNumber routed ";
|
||||
$context = $aInfo;
|
||||
Log::channel(':MessageEventCron')->info($message, Bootstrap::context($context));
|
||||
} else {
|
||||
$aInfo = array(
|
||||
'ip' => \G::getIpAddress()
|
||||
@@ -587,12 +576,9 @@ class MessageApplication
|
||||
,'evnUid' => $value['EVN_UID']
|
||||
,'evnName' => $value['EVN_NAME']
|
||||
);
|
||||
$this->syslog(
|
||||
500
|
||||
,"Failed case #$appNumber. " . $arrayResult["message"]
|
||||
,'ROUTED-NEW-CASE'
|
||||
,$aInfo
|
||||
);
|
||||
$message = "Failed case #$appNumber. " . $arrayResult["message"];
|
||||
$context = $aInfo;
|
||||
Log::channel(':MessageEventCron')->critical($message, Bootstrap::context($context));
|
||||
}
|
||||
|
||||
$flagCatched = true;
|
||||
@@ -626,26 +612,15 @@ class MessageApplication
|
||||
$common->frontEndShow("TEXT", "Total cases started: " . $counterStartMessageEvent);
|
||||
$common->frontEndShow("TEXT", "Total cases continued: " . $counterIntermediateCatchMessageEvent);
|
||||
$common->frontEndShow("TEXT", "Total Message-Events pending: " . ($totalMessageEvent - ($counterStartMessageEvent + $counterIntermediateCatchMessageEvent)));
|
||||
$this->syslog(
|
||||
200
|
||||
,'Total Message-Events unread '. $totalMessageEvent
|
||||
,'RESUME'//Action
|
||||
);
|
||||
$this->syslog(
|
||||
200
|
||||
,'Total cases started '. $counterStartMessageEvent
|
||||
,'RESUME'//Action
|
||||
);
|
||||
$this->syslog(
|
||||
200
|
||||
,'Total cases continued '. $counterIntermediateCatchMessageEvent
|
||||
,'RESUME'//Action
|
||||
);
|
||||
$this->syslog(
|
||||
200
|
||||
,'Total Message-Events pending '. ($totalMessageEvent - ($counterStartMessageEvent + $counterIntermediateCatchMessageEvent))
|
||||
,'RESUME'//Action
|
||||
);
|
||||
$context = [];
|
||||
$message = 'Total Message-Events unread ' . $totalMessageEvent;
|
||||
Log::channel(':MessageEventCron')->info($message, Bootstrap::context($context));
|
||||
$message = 'Total cases started ' . $counterStartMessageEvent;
|
||||
Log::channel(':MessageEventCron')->info($message, Bootstrap::context($context));
|
||||
$message = 'Total cases continued ' . $counterIntermediateCatchMessageEvent;
|
||||
Log::channel(':MessageEventCron')->info($message, Bootstrap::context($context));
|
||||
$message = 'Total Message-Events pending ' . ($totalMessageEvent - ($counterStartMessageEvent + $counterIntermediateCatchMessageEvent));
|
||||
Log::channel(':MessageEventCron')->info($message, Bootstrap::context($context));
|
||||
|
||||
$common->frontEndShow("END");
|
||||
} catch (\Exception $e) {
|
||||
@@ -653,39 +628,4 @@ class MessageApplication
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The Syslog register the information in Monolog Class
|
||||
*
|
||||
* @param int $level DEBUG=100 INFO=200 NOTICE=250 WARNING=300 ERROR=400 CRITICAL=500
|
||||
* @param string $message
|
||||
* @param string $ipClient for Context information
|
||||
* @param string $action for Context information
|
||||
* @param string $timeZone for Context information
|
||||
* @param string $workspace for Context information
|
||||
* @param string $usrUid for Context information
|
||||
* @param string $proUid for Context information
|
||||
* @param string $tasUid for Context information
|
||||
* @param string $appUid for Context information
|
||||
* @param string $delIndex for Context information
|
||||
* @param string $stepUid for Context information
|
||||
* @param string $triUid for Context information
|
||||
* @param string $outDocUid for Context information
|
||||
* @param string $inpDocUid for Context information
|
||||
* @param string $url for Context information
|
||||
*
|
||||
* return void
|
||||
*/
|
||||
private function syslog(
|
||||
$level,
|
||||
$message,
|
||||
$action='',
|
||||
$aContext = array()
|
||||
)
|
||||
{
|
||||
try {
|
||||
\Bootstrap::registerMonolog('MessageEventCron', $level, $message, $aContext, config("system.workspace"), 'processmaker.log');
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace ProcessMaker\BusinessModel;
|
||||
|
||||
use Bootstrap;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class TimerEvent
|
||||
{
|
||||
private $arrayFieldDefinition = array(
|
||||
@@ -1162,42 +1166,6 @@ class TimerEvent
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The Syslog register the information in Monolog Class
|
||||
*
|
||||
* @param int $level DEBUG=100 INFO=200 NOTICE=250 WARNING=300 ERROR=400 CRITICAL=500
|
||||
* @param string $message
|
||||
* @param string $ipClient for Context information
|
||||
* @param string $action for Context information
|
||||
* @param string $timeZone for Context information
|
||||
* @param string $workspace for Context information
|
||||
* @param string $usrUid for Context information
|
||||
* @param string $proUid for Context information
|
||||
* @param string $tasUid for Context information
|
||||
* @param string $appUid for Context information
|
||||
* @param string $delIndex for Context information
|
||||
* @param string $stepUid for Context information
|
||||
* @param string $triUid for Context information
|
||||
* @param string $outDocUid for Context information
|
||||
* @param string $inpDocUid for Context information
|
||||
* @param string $url for Context information
|
||||
*
|
||||
* return void
|
||||
*/
|
||||
private function syslog(
|
||||
$level,
|
||||
$message,
|
||||
$action='',
|
||||
$aContext = array()
|
||||
)
|
||||
{
|
||||
try {
|
||||
\Bootstrap::registerMonolog('TimerEventCron', $level, $message, $aContext, config("system.workspace"), 'processmaker.log');
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Start/Continue case by Timer-Event
|
||||
*
|
||||
@@ -1237,12 +1205,9 @@ class TimerEvent
|
||||
,'timeZone' => $datetime
|
||||
,'workspace'=> $sysSys
|
||||
);
|
||||
$this->syslog(
|
||||
200
|
||||
,'Start new cases'
|
||||
,'START-NEW-CASES'
|
||||
,$aInfo
|
||||
);
|
||||
$message = 'Start new cases';
|
||||
$context = $aInfo;
|
||||
Log::channel(':TimerEventCron')->info($message, Bootstrap::context($context));
|
||||
|
||||
//Query
|
||||
$criteria = $this->getTimerEventCriteria();
|
||||
@@ -1399,12 +1364,9 @@ class TimerEvent
|
||||
,'evnUid' => $row['EVN_UID']
|
||||
,'evnName' => $row['EVN_NAME']
|
||||
);
|
||||
$this->syslog(
|
||||
200
|
||||
,"Case #$applicationNumber created"
|
||||
,'CREATED-NEW-CASE'
|
||||
,$aInfo
|
||||
);
|
||||
$message = "Case #$applicationNumber created";
|
||||
$context = $aInfo;
|
||||
Log::channel(':TimerEventCron')->info($message, Bootstrap::context($context));
|
||||
|
||||
//Derivate new case
|
||||
$result = $ws->derivateCase("", $applicationUid, 1);
|
||||
@@ -1428,12 +1390,9 @@ class TimerEvent
|
||||
,'evnUid' => $row['EVN_UID']
|
||||
,'evnName' => $row['EVN_NAME']
|
||||
);
|
||||
$this->syslog(
|
||||
200
|
||||
,"Case #$applicationNumber routed"
|
||||
,'ROUTED-NEW-CASE'
|
||||
,$aInfo
|
||||
);
|
||||
$message = "Case #$applicationNumber routed";
|
||||
$context = $aInfo;
|
||||
Log::channel(':TimerEventCron')->info($message, Bootstrap::context($context));
|
||||
} else {
|
||||
$common->frontEndShow("TEXT", " - Failed: " . $arrayResult["message"]);
|
||||
|
||||
@@ -1451,12 +1410,9 @@ class TimerEvent
|
||||
,'evnUid' => $row['EVN_UID']
|
||||
,'evnName' => $row['EVN_NAME']
|
||||
);
|
||||
$this->syslog(
|
||||
500
|
||||
,"Failed case #$applicationNumber. " . $arrayResult["message"]
|
||||
,'ROUTED-NEW-CASE'
|
||||
,$aInfo
|
||||
);
|
||||
$message = "Failed case #$applicationNumber. " . $arrayResult["message"];
|
||||
$context = $aInfo;
|
||||
Log::channel(':TimerEventCron')->critical($message, Bootstrap::context($context));
|
||||
}
|
||||
} else {
|
||||
$common->frontEndShow("TEXT", " - Failed: " . $arrayResult["message"]);
|
||||
@@ -1472,12 +1428,9 @@ class TimerEvent
|
||||
,'evnUid' => $row['EVN_UID']
|
||||
,'evnName' => $row['EVN_NAME']
|
||||
);
|
||||
$this->syslog(
|
||||
500
|
||||
,"Failed case #$applicationNumber. " . $arrayResult["message"]
|
||||
,'CREATED-NEW-CASE'
|
||||
,$aInfo
|
||||
);
|
||||
$message = "Failed case #$applicationNumber. " . $arrayResult["message"];
|
||||
$context = $aInfo;
|
||||
Log::channel(':TimerEventCron')->critical($message, Bootstrap::context($context));
|
||||
}
|
||||
|
||||
$flagRecord = true;
|
||||
@@ -1491,15 +1444,12 @@ class TimerEvent
|
||||
$aInfo = array(
|
||||
'ip' => \G::getIpAddress()
|
||||
,'action' => $action
|
||||
,'TimeZone' => $datetime
|
||||
,'timeZone' => $datetime
|
||||
,'workspace'=> $sysSys
|
||||
);
|
||||
$this->syslog(
|
||||
200
|
||||
,'Not exists any record to start a new case'
|
||||
,'NO-RECORDS'
|
||||
,$aInfo
|
||||
);
|
||||
$message = 'Not exists any record to start a new case';
|
||||
$context = $aInfo;
|
||||
Log::channel(':TimerEventCron')->info($message, Bootstrap::context($context));
|
||||
}
|
||||
|
||||
$common->frontEndShow("END");
|
||||
@@ -1510,15 +1460,12 @@ class TimerEvent
|
||||
$aInfo = array(
|
||||
'ip' => \G::getIpAddress()
|
||||
,'action' => $action
|
||||
,'TimeZone' => $datetime
|
||||
,'timeZone' => $datetime
|
||||
,'workspace'=> $sysSys
|
||||
);
|
||||
$this->syslog(
|
||||
200
|
||||
,'Start continue the cases'
|
||||
,'START-CONTINUE-CASES'
|
||||
,$aInfo
|
||||
);
|
||||
$message = 'Start continue the cases';
|
||||
$context = $aInfo;
|
||||
Log::channel(':TimerEventCron')->info($message, Bootstrap::context($context));
|
||||
|
||||
//Query
|
||||
$criteriaMain = $this->getTimerEventCriteria();
|
||||
@@ -1708,12 +1655,9 @@ class TimerEvent
|
||||
,'evnUid' => $row['EVN_UID']
|
||||
,'evnName' => $row['EVN_NAME']
|
||||
);
|
||||
$this->syslog(
|
||||
200
|
||||
,"Case #$applicationNumber continued"
|
||||
,'CONTINUED-CASE'
|
||||
,$aInfo
|
||||
);
|
||||
$message = "Case #$applicationNumber continued";
|
||||
$context = $aInfo;
|
||||
Log::channel(':TimerEventCron')->info($message, Bootstrap::context($context));
|
||||
} else {
|
||||
$common->frontEndShow("TEXT", " - Failed: " . $arrayResult["message"]);
|
||||
|
||||
@@ -1730,12 +1674,9 @@ class TimerEvent
|
||||
,'evnUid' => $row['EVN_UID']
|
||||
,'evnName' => $row['EVN_NAME']
|
||||
);
|
||||
$this->syslog(
|
||||
500
|
||||
,"Failed case #$applicationUid. " . $arrayResult["message"]
|
||||
,'CONTINUED-CASE'
|
||||
,$aInfo
|
||||
);
|
||||
$message = "Failed case #$applicationUid. " . $arrayResult["message"];
|
||||
$context = $aInfo;
|
||||
Log::channel(':TimerEventCron')->critical($message, Bootstrap::context($context));
|
||||
}
|
||||
|
||||
$flagRecord = true;
|
||||
@@ -1754,12 +1695,9 @@ class TimerEvent
|
||||
,'evnUid' => $row['EVN_UID']
|
||||
,'evnName' => $row['EVN_NAME']
|
||||
);
|
||||
$this->syslog(
|
||||
200
|
||||
,'Continue date '. $continueCaseDate
|
||||
,'INVALID-CONTINUE-DATE'
|
||||
,$aInfo
|
||||
);
|
||||
$message = 'Invalid date to continue ' . $continueCaseDate;
|
||||
$context = $aInfo;
|
||||
Log::channel(':TimerEventCron')->info($message, Bootstrap::context($context));
|
||||
}
|
||||
|
||||
$counter++;
|
||||
@@ -1777,15 +1715,12 @@ class TimerEvent
|
||||
$aInfo = array(
|
||||
'ip' => \G::getIpAddress()
|
||||
,'action' => $action
|
||||
,'TimeZone' => $datetime
|
||||
,'timeZone' => $datetime
|
||||
,'workspace'=> $sysSys
|
||||
);
|
||||
$this->syslog(
|
||||
200
|
||||
,'No existing records to continue a case'
|
||||
,'NO-RECORDS'
|
||||
,$aInfo
|
||||
);
|
||||
$message = 'No existing records to continue a case';
|
||||
$context = $aInfo;
|
||||
Log::channel(':TimerEventCron')->info($message, Bootstrap::context($context));
|
||||
}
|
||||
|
||||
$common->frontEndShow("END");
|
||||
|
||||
@@ -49,6 +49,7 @@ class JobsManager
|
||||
'__SYSTEM_UTC_TIME_ZONE__',
|
||||
'USER_LOGGED',
|
||||
'USR_USERNAME',
|
||||
'USR_TIME_ZONE',
|
||||
'APPLICATION',
|
||||
'INDEX',
|
||||
'PROCESS',
|
||||
@@ -126,6 +127,11 @@ class JobsManager
|
||||
'constants' => $constants['user'],
|
||||
'session' => $session,
|
||||
'server' => $_SERVER,
|
||||
'phpEnv' => [
|
||||
'HTTP_CLIENT_IP' => getenv('HTTP_CLIENT_IP'),
|
||||
'HTTP_X_FORWARDED_FOR' => getenv('HTTP_X_FORWARDED_FOR'),
|
||||
'REMOTE_ADDR' => getenv('REMOTE_ADDR'),
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
@@ -148,6 +154,13 @@ class JobsManager
|
||||
|
||||
Propel::close();
|
||||
Propel::init(PATH_CONFIG . "databases.php");
|
||||
|
||||
foreach ($environment['phpEnv'] as $key => $value) {
|
||||
if (empty($value)) {
|
||||
continue;
|
||||
}
|
||||
putenv("{$key}={$value}");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -195,12 +208,12 @@ class JobsManager
|
||||
$this->recoverDataSnapshot($environment);
|
||||
$callback($environment);
|
||||
} catch (Exception $e) {
|
||||
Log::error($e->getMessage() . ": " . $e->getTraceAsString());
|
||||
$message = $e->getMessage();
|
||||
$context = [
|
||||
"trace" => $e->getTraceAsString(),
|
||||
"workspace" => $environment["constants"]["SYS_SYS"]
|
||||
];
|
||||
Bootstrap::registerMonolog("queue:work", 400, $e->getMessage(), $context, "");
|
||||
Log::channel(':queue-work')->error($message, Bootstrap::context($context));
|
||||
throw $e;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -8,6 +8,7 @@ use G;
|
||||
use Google_Client;
|
||||
use Google_Service_Gmail;
|
||||
use Google_Service_Gmail_Message;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use PHPMailerOAuth;
|
||||
use ProcessMaker\BusinessModel\EmailServer;
|
||||
use ProcessMaker\Core\System;
|
||||
@@ -464,8 +465,6 @@ class GmailOAuth
|
||||
*/
|
||||
public function saveIntoStandardLogs(string $status = "")
|
||||
{
|
||||
$channel = "Test Email Servers Configuration";
|
||||
$severity = 200; //INFO
|
||||
$message = "Email Server test has been sent";
|
||||
$context = [
|
||||
"emailServerUid" => $this->emailServerUid,
|
||||
@@ -476,7 +475,6 @@ class GmailOAuth
|
||||
"senderName" => $this->senderName,
|
||||
"status" => $status
|
||||
];
|
||||
$workspace = config("system.workspace");
|
||||
Bootstrap::registerMonolog($channel, $severity, $message, $context, $workspace);
|
||||
Log::channel(':GmailOAuth')->info($message, Bootstrap::context($context));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace ProcessMaker\Project;
|
||||
|
||||
use BasePeer;
|
||||
@@ -29,6 +30,7 @@ use BpmnProcessPeer as ProcessPeer;
|
||||
use Criteria as Criteria;
|
||||
use Exception;
|
||||
use G;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use ResultSet as ResultSet;
|
||||
use ProcessMaker\Util\Common;
|
||||
use ProcessMaker\Exception\ProjectNotFound;
|
||||
@@ -278,13 +280,9 @@ class Bpmn extends Handler
|
||||
}
|
||||
$me = new self();
|
||||
$me->setContextLog($response);
|
||||
$me->syslog(
|
||||
'DoBulkDelete',
|
||||
200,
|
||||
'Do bulk delete',
|
||||
$me->getContextLog()
|
||||
);
|
||||
|
||||
$message = 'Do bulk delete';
|
||||
$context = $me->getContextLog();
|
||||
Log::channel(':DoBulkDelete')->info($message, Bootstrap::context($context));
|
||||
return $response;
|
||||
}
|
||||
|
||||
@@ -1676,28 +1674,4 @@ class Bpmn extends Handler
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Logging information related to project
|
||||
* When the user doDeleteBulk
|
||||
*
|
||||
* @param string $channel
|
||||
* @param string $level
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
*
|
||||
* @return void
|
||||
* @throws Exception
|
||||
*/
|
||||
private function syslog(
|
||||
$channel,
|
||||
$level,
|
||||
$message,
|
||||
$context = array()
|
||||
) {
|
||||
try {
|
||||
Bootstrap::registerMonolog($channel, $level, $message, $context, $context['workspace'], 'processmaker.log');
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace ProcessMaker\Util;
|
||||
|
||||
use Bootstrap;
|
||||
use G;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
/**
|
||||
* Constructs the name of the variable starting from a string representing the
|
||||
@@ -21,11 +24,12 @@ class ParseSoapVariableName
|
||||
public function buildVariableName(&$field, $name, $value)
|
||||
{
|
||||
if (!$this->isValidVariableName($name)) {
|
||||
$context = \Bootstrap::getDefaultContextLog();
|
||||
$context['action'] = 'soap2';
|
||||
$context['exception'] = 'Invalid param: '.G::json_encode($name);
|
||||
\Bootstrap::registerMonolog('soap2', 400, 'NewCase', $context, $context['workspace'], 'processmaker.log');
|
||||
|
||||
$message = 'NewCase';
|
||||
$context = [
|
||||
'action' => 'soap2',
|
||||
'exception' => 'Invalid param: '.G::json_encode($name)
|
||||
];
|
||||
Log::channel(':soap2')->error($message, Bootstrap::context($context));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ use Bootstrap;
|
||||
use G;
|
||||
use Illuminate\Filesystem\Filesystem;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Monolog\Logger;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use ProcessMaker\Core\System;
|
||||
use ProcessMaker\Services\OAuth2\Server;
|
||||
use ProcessMaker\Util\PhpShorthandByte;
|
||||
@@ -62,18 +62,12 @@ class ValidationUploadedFiles
|
||||
->status(550)
|
||||
->message(G::LoadTranslation('ID_THE_UPLOAD_OF_PHP_FILES_WAS_DISABLED'))
|
||||
->log(function($rule) {
|
||||
/**
|
||||
* Levels supported by MonologProvider is:
|
||||
* 100 "DEBUG"
|
||||
* 200 "INFO"
|
||||
* 250 "NOTICE"
|
||||
* 300 "WARNING"
|
||||
* 400 "ERROR"
|
||||
* 500 "CRITICAL"
|
||||
* 550 "ALERT"
|
||||
* 600 "EMERGENCY"
|
||||
*/
|
||||
Bootstrap::registerMonologPhpUploadExecution('phpUpload', 550, $rule->getMessage(), $rule->getData()->filename);
|
||||
$message = $rule->getMessage();
|
||||
$context = [
|
||||
'filename' => $rule->getData()->filename,
|
||||
'url' => $_SERVER["REQUEST_URI"] ?? ''
|
||||
];
|
||||
Log::channel(':phpUpload')->alert($message, Bootstrap::context($context));
|
||||
});
|
||||
|
||||
//rule: upload_attempts_limit_per_user
|
||||
@@ -100,18 +94,12 @@ class ValidationUploadedFiles
|
||||
->status(429)
|
||||
->message(G::LoadTranslation('ID_TOO_MANY_REQUESTS'))
|
||||
->log(function($rule) {
|
||||
/**
|
||||
* Levels supported by MonologProvider is:
|
||||
* 100 "DEBUG"
|
||||
* 200 "INFO"
|
||||
* 250 "NOTICE"
|
||||
* 300 "WARNING"
|
||||
* 400 "ERROR"
|
||||
* 500 "CRITICAL"
|
||||
* 550 "ALERT"
|
||||
* 600 "EMERGENCY"
|
||||
*/
|
||||
Bootstrap::registerMonologPhpUploadExecution('phpUpload', 250, $rule->getMessage(), $rule->getData()->filename);
|
||||
$message = $rule->getMessage();
|
||||
$context = [
|
||||
'filename' => $rule->getData()->filename,
|
||||
'url' => $_SERVER["REQUEST_URI"] ?? ''
|
||||
];
|
||||
Log::channel(':phpUpload')->notice($message, Bootstrap::context($context));
|
||||
});
|
||||
|
||||
//rule: mimeType
|
||||
@@ -160,18 +148,12 @@ class ValidationUploadedFiles
|
||||
->status(415)
|
||||
->message(G::LoadTranslation('ID_THE_MIMETYPE_EXTENSION_ERROR'))
|
||||
->log(function($rule) {
|
||||
/**
|
||||
* Levels supported by MonologProvider is:
|
||||
* 100 "DEBUG"
|
||||
* 200 "INFO"
|
||||
* 250 "NOTICE"
|
||||
* 300 "WARNING"
|
||||
* 400 "ERROR"
|
||||
* 500 "CRITICAL"
|
||||
* 550 "ALERT"
|
||||
* 600 "EMERGENCY"
|
||||
*/
|
||||
Bootstrap::registerMonologPhpUploadExecution('phpUpload', 250, $rule->getMessage(), $rule->getData()->filename);
|
||||
$message = $rule->getMessage();
|
||||
$context = [
|
||||
'filename' => $rule->getData()->filename,
|
||||
'url' => $_SERVER["REQUEST_URI"] ?? ''
|
||||
];
|
||||
Log::channel(':phpUpload')->notice($message, Bootstrap::context($context));
|
||||
});
|
||||
|
||||
return $validator->validate();
|
||||
@@ -285,7 +267,12 @@ class ValidationUploadedFiles
|
||||
})
|
||||
->status(400)
|
||||
->log(function($rule) {
|
||||
Bootstrap::registerMonologPhpUploadExecution('phpUpload', 400, $rule->getMessage(), "");
|
||||
$message = $rule->getMessage();
|
||||
$context = [
|
||||
'filename' => "",
|
||||
'url' => $_SERVER["REQUEST_URI"] ?? ''
|
||||
];
|
||||
Log::channel(':phpUpload')->error($message, Bootstrap::context($context));
|
||||
});
|
||||
|
||||
return $validator->validate();
|
||||
@@ -315,9 +302,14 @@ class ValidationUploadedFiles
|
||||
}
|
||||
return self::VALID;
|
||||
})
|
||||
->status(Logger::ERROR)
|
||||
->status(400)
|
||||
->log(function($rule) {
|
||||
Bootstrap::registerMonologPhpUploadExecution('phpUpload', Logger::ERROR, $rule->getMessage(), $rule->getData()->filename);
|
||||
$message = $rule->getMessage();
|
||||
$context = [
|
||||
'filename' => $rule->getData()->filename,
|
||||
'url' => $_SERVER["REQUEST_URI"] ?? ''
|
||||
];
|
||||
Log::channel(':phpUpload')->error($message, Bootstrap::context($context));
|
||||
});
|
||||
|
||||
//rule: extensions
|
||||
@@ -334,9 +326,14 @@ class ValidationUploadedFiles
|
||||
}
|
||||
return self::VALID;
|
||||
})
|
||||
->status(Logger::ERROR)
|
||||
->status(400)
|
||||
->log(function($rule) {
|
||||
Bootstrap::registerMonologPhpUploadExecution('phpUpload', Logger::ERROR, $rule->getMessage(), $rule->getData()->filename);
|
||||
$message = $rule->getMessage();
|
||||
$context = [
|
||||
'filename' => $rule->getData()->filename,
|
||||
'url' => $_SERVER["REQUEST_URI"] ?? ''
|
||||
];
|
||||
Log::channel(':phpUpload')->error($message, Bootstrap::context($context));
|
||||
});
|
||||
|
||||
//rule: file size
|
||||
@@ -354,9 +351,14 @@ class ValidationUploadedFiles
|
||||
}
|
||||
return self::VALID;
|
||||
})
|
||||
->status(Logger::ERROR)
|
||||
->status(400)
|
||||
->log(function($rule) {
|
||||
Bootstrap::registerMonologPhpUploadExecution('phpUpload', Logger::ERROR, $rule->getMessage(), $rule->getData()->filename);
|
||||
$message = $rule->getMessage();
|
||||
$context = [
|
||||
'filename' => $rule->getData()->filename,
|
||||
'url' => $_SERVER["REQUEST_URI"] ?? ''
|
||||
];
|
||||
Log::channel(':phpUpload')->error($message, Bootstrap::context($context));
|
||||
});
|
||||
|
||||
return $validator->validate();
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Foundation\Http\Kernel;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use ProcessMaker\Core\AppEvent;
|
||||
use ProcessMaker\Core\JobsManager;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
@@ -827,13 +828,22 @@ if (substr(SYS_COLLECTION, 0, 8) === 'gulliver') {
|
||||
$isWebEntry = \ProcessMaker\BusinessModel\WebEntry::isWebEntry(SYS_COLLECTION, $phpFile);
|
||||
if (\Bootstrap::getDisablePhpUploadExecution() === 1 && !$isWebEntry) {
|
||||
$message = \G::LoadTranslation('ID_THE_PHP_FILES_EXECUTION_WAS_DISABLED');
|
||||
\Bootstrap::registerMonologPhpUploadExecution('phpExecution', 550, $message, $phpFile);
|
||||
$context = [
|
||||
'filename' => $phpFile,
|
||||
'url' => $_SERVER["REQUEST_URI"] ?? ''
|
||||
];
|
||||
Log::channel(':phpExecution')->alert($message, \Bootstrap::context($context));
|
||||
echo $message;
|
||||
die();
|
||||
} else {
|
||||
//Backward compatibility: Preload PmDynaform for old generated webentry files.
|
||||
class_exists('PmDynaform');
|
||||
\Bootstrap::registerMonologPhpUploadExecution('phpExecution', 200, 'Php Execution', $phpFile);
|
||||
$message = 'Php Execution';
|
||||
$context = [
|
||||
'filename' => $phpFile,
|
||||
'url' => $_SERVER["REQUEST_URI"] ?? ''
|
||||
];
|
||||
Log::channel(':phpExecution')->info($message, \Bootstrap::context($context));
|
||||
}
|
||||
|
||||
$avoidChangedWorkspaceValidation = true;
|
||||
|
||||
Reference in New Issue
Block a user