EspoCRM – Open Source CRM Application
PHP calendarcontactscrmcrm-platformcrm-systemcustomer-portalcustomer-supportcustomizabledocumentsemail-marketingkanbanleadsopen-sourcephpplatformsales-automationsingle-page-applicationsupport
Logging fixes
Yurii6f8ce0c0877f
diff --git a/application/Espo/Core/Api/Auth.php b/application/Espo/Core/Api/Auth.phpindex 5adebab6a5..0c11c44be2 100644--- a/application/Espo/Core/Api/Auth.php+++ b/application/Espo/Core/Api/Auth.php@@ -241,7 +241,7 @@ class Auth}if ($e->getMessage()) {- $this->log->notice("Auth exception: {message}", ['message' => $e->getMessage()]);+ $this->log->notice("Auth exception.", ['exception' => $e]);}return;diff --git a/application/Espo/Core/Authentication/Ldap/LdapLogin.php b/application/Espo/Core/Authentication/Ldap/LdapLogin.phpindex f51541f7d5..bba7939071 100644--- a/application/Espo/Core/Authentication/Ldap/LdapLogin.php+++ b/application/Espo/Core/Authentication/Ldap/LdapLogin.php@@ -160,9 +160,9 @@ class LdapLogin implements Login} catch (Exception $e) {$options = $this->utils->getLdapClientOptions();- $this->log->error("LDAP: Could not connect to LDAP server host. {message}", [+ $this->log->error("LDAP: Could not connect to LDAP server host.", ['host' => $options['host'],- 'message' => $e->getMessage()+ 'exception' => $e,]);/** @var string $username */@@ -186,9 +186,9 @@ class LdapLogin implements Logintry {$userDn = $this->findLdapUserDnByUsername($username);} catch (Exception $e) {- $this->log->error("Error while finding DN for '{username}'. {message}", [+ $this->log->error("Error while finding DN for '{username}'.", ['username' => $username,- 'message' => $e->getMessage(),+ 'exception' => $e,]);}@@ -216,9 +216,9 @@ class LdapLogin implements Logintry {$ldapClient->bind($userDn, $password);} catch (Exception $e) {- $this->log->error("LDAP: Authentication failed for '{username}'. {message}", [+ $this->log->error("LDAP: Authentication failed for '{username}'.", ['username' => $username,- 'message' => $e->getMessage(),+ 'exception' => $e,]);return Result::fail();@@ -268,7 +268,7 @@ class LdapLogin implements Logintry {$this->client = $this->clientFactory->create($options);} catch (Exception $e) {- $this->log->error("LDAP error. {message}", ['message' => $e->getMessage()]);+ $this->log->error("LDAP error.", ['exception' => $e]);}}diff --git a/application/Espo/Core/Job/JobRunner.php b/application/Espo/Core/Job/JobRunner.phpindex a394cad5f7..0420ebe1ed 100644--- a/application/Espo/Core/Job/JobRunner.php+++ b/application/Espo/Core/Job/JobRunner.php@@ -133,7 +133,6 @@ class JobRunner$this->log->critical("Failed job {id}.", ['exception' => $e,- 'message' => $e->getMessage(),Attribute::ID => $jobId,]);diff --git a/application/Espo/Core/Mail/Account/GroupAccount/Service.php b/application/Espo/Core/Mail/Account/GroupAccount/Service.phpindex b6115de154..9c2b14f79c 100644--- a/application/Espo/Core/Mail/Account/GroupAccount/Service.php+++ b/application/Espo/Core/Mail/Account/GroupAccount/Service.php@@ -133,9 +133,8 @@ class Service$storage = $this->storageFactory->createWithParams($params);$storage->getFolderNames();} catch (Exception $e) {- $this->log->warning("IMAP test connection failed; {message}", [+ $this->log->warning("IMAP test connection failed.", ['exception' => $e,- 'message' => $e->getMessage(),]);$message = $e instanceof ImapError ?diff --git a/application/Espo/Core/Mail/Account/PersonalAccount/Service.php b/application/Espo/Core/Mail/Account/PersonalAccount/Service.phpindex 89a747ee7f..a915d9bd1f 100644--- a/application/Espo/Core/Mail/Account/PersonalAccount/Service.php+++ b/application/Espo/Core/Mail/Account/PersonalAccount/Service.php@@ -168,9 +168,8 @@ class Service$storage = $this->storageFactory->createWithParams($params);$storage->getFolderNames();} catch (Exception $e) {- $this->log->warning("IMAP test connection failed; {message}", [+ $this->log->warning("IMAP test connection failed.", ['exception' => $e,- 'message' => $e->getMessage(),]);$message = $e instanceof ImapError ?diff --git a/application/Espo/Core/Webhook/Queue.php b/application/Espo/Core/Webhook/Queue.phpindex f0668b4043..2076380df7 100644--- a/application/Espo/Core/Webhook/Queue.php+++ b/application/Espo/Core/Webhook/Queue.php@@ -283,10 +283,9 @@ class Queue} catch (Exception $e) {$this->failQueueItemList($itemList, true);- $this->log->error("Webhook Queue: Webhook '{id}' sending failed; {message}", [+ $this->log->error("Webhook Queue: Webhook '{id}' sending failed.", ['exception' => $e,'id' => $webhook->getId(),- 'message' => $e->getMessage(),]);return;diff --git a/application/Espo/Modules/Crm/Jobs/ProcessMassEmail.php b/application/Espo/Modules/Crm/Jobs/ProcessMassEmail.phpindex 0c49edc993..fb6916bc5f 100644--- a/application/Espo/Modules/Crm/Jobs/ProcessMassEmail.php+++ b/application/Espo/Modules/Crm/Jobs/ProcessMassEmail.php@@ -70,9 +70,8 @@ class ProcessMassEmail implements JobDataLesstry {$this->queue->create($massEmail);} catch (Throwable $e) {- $this->log->error("Create queue error. {id}. {message}", [+ $this->log->error("Create queue error. {id}.", ['id' => $massEmail->getId(),- 'message' => $e->getMessage(),'exception' => $e,]);}@@ -92,9 +91,8 @@ class ProcessMassEmail implements JobDataLesstry {$this->processor->process($massEmail);} catch (Throwable $e) {- $this->log->error("Sending mass email error. {id}. {message}", [+ $this->log->error("Sending mass email error. {id}.", ['id' => $massEmail->getId(),- 'message' => $e->getMessage(),'exception' => $e,]);}diff --git a/application/Espo/Tools/Email/InboxService.php b/application/Espo/Tools/Email/InboxService.phpindex 7cdd970c2b..d3a77c3078 100644--- a/application/Espo/Tools/Email/InboxService.php+++ b/application/Espo/Tools/Email/InboxService.php@@ -99,7 +99,7 @@ class InboxServicetry {$this->moveToGroupFolder($email, substr($folderId, 6), $user);} catch (Exception $e) {- $this->log->debug("Could not move email to group folder. {message}", ['message' => $e->getMessage()]);+ $this->log->debug("Could not move email to group folder.", ['exception' => $e]);throw $e;}diff --git a/application/Espo/Tools/Email/SendService.php b/application/Espo/Tools/Email/SendService.phpindex cad3e97f75..36dfb40518 100644--- a/application/Espo/Tools/Email/SendService.php+++ b/application/Espo/Tools/Email/SendService.php@@ -234,7 +234,7 @@ class SendService$this->entityManager->saveEntity($entity, [SaveOption::SILENT => true]);- $this->log->error("Email sending: " . $e->getMessage(), ['exception' => $e]);+ $this->log->error("Email sending error.", ['exception' => $e]);$errorData = ['id' => $entity->getId(),