Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/mail.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kesselberg <mail@danielkesselberg.de>2022-05-17 18:07:30 +0300
committerDaniel Kesselberg <mail@danielkesselberg.de>2022-05-17 18:07:30 +0300
commitab9ade57fbc1f465ffe905248f93f328d638d7e5 (patch)
tree06e537122657a9b79e5b9a52d9df6f8920b9047e /lib/Controller
parenta96e8d5eaa6c9f44a175f09c571f157283cd9ec7 (diff)
Reduce log messages by account auto detectdebt/noid/reduce-log-spam
Account auto detect produce a lot of log messages spamming the log file. This pr will reduce the verbosity of the logged information Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Diffstat (limited to 'lib/Controller')
-rw-r--r--lib/Controller/AccountsController.php11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/Controller/AccountsController.php b/lib/Controller/AccountsController.php
index 4ab70b4cf..be33c47a2 100644
--- a/lib/Controller/AccountsController.php
+++ b/lib/Controller/AccountsController.php
@@ -336,7 +336,6 @@ class AccountsController extends Controller {
* @param bool $autoDetect
*
* @return JSONResponse
- * @throws ClientException
*/
public function create(string $accountName, string $emailAddress, string $password = null, string $imapHost = null, int $imapPort = null, string $imapSslMode = null, string $imapUser = null, string $imapPassword = null, string $smtpHost = null, int $smtpPort = null, string $smtpSslMode = null, string $smtpUser = null, string $smtpPassword = null, bool $autoDetect = true): JSONResponse {
try {
@@ -346,15 +345,15 @@ class AccountsController extends Controller {
$account = $this->setup->createNewAccount($accountName, $emailAddress, $imapHost, $imapPort, $imapSslMode, $imapUser, $imapPassword, $smtpHost, $smtpPort, $smtpSslMode, $smtpUser, $smtpPassword, $this->currentUserId);
}
} catch (CouldNotConnectException $e) {
- $this->logger->info('Creating account failed: ' . $e->getMessage(), [
- 'exception' => $e,
- ]);
- return \OCA\Mail\Http\JsonResponse::fail([
+ $data = [
'error' => $e->getReason(),
'service' => $e->getService(),
'host' => $e->getHost(),
'port' => $e->getPort(),
- ]);
+ ];
+
+ $this->logger->info('Creating account failed: ' . $e->getMessage(), $data);
+ return \OCA\Mail\Http\JsonResponse::fail($data);
} catch (ServiceException $e) {
$this->logger->error('Creating account failed: ' . $e->getMessage(), [
'exception' => $e,