diff --git a/helm/values.yaml b/helm/values.yaml index a23c75fc..4d585850 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -11,7 +11,7 @@ worker: queueWorkers: 1 logging: - level: DEBUG + level: INFO letsencrypt: email: ascoderu.opwen@gmail.com diff --git a/opwen_email_server/services/auth.py b/opwen_email_server/services/auth.py index 40974eab..47df646c 100644 --- a/opwen_email_server/services/auth.py +++ b/opwen_email_server/services/auth.py @@ -141,20 +141,20 @@ def __init__(self, storage: AzureTextStorage) -> None: def insert(self, client_id: str, domain: str, owner: str): self._storage.store_text(client_id, domain) self._storage.store_text(domain, to_json({'client_id': client_id, 'owner': owner})) - self.log_debug('Registered client %s at domain %s', client_id, domain) + self.log_info('Registered client %s at domain %s', client_id, domain) def is_owner(self, domain: str, username: str) -> bool: try: raw_auth = self._storage.fetch_text(domain) except ObjectDoesNotExistError: - self.log_debug('Unrecognized domain %s', domain) + self.log_warning('Unrecognized domain %s', domain) return False try: auth = from_json(raw_auth) except JSONDecodeError: # fallback for clients registered before November 2019 - self.log_debug('Unable to lookup owner for domain %s', domain) + self.log_warning('Unable to lookup owner for domain %s', domain) return False return auth.get('owner') == username @@ -168,7 +168,7 @@ def client_id_for(self, domain: str) -> Optional[str]: try: raw_auth = self._storage.fetch_text(domain) except ObjectDoesNotExistError: - self.log_debug('Unrecognized domain %s', domain) + self.log_warning('Unrecognized domain %s', domain) return None else: try: @@ -183,7 +183,7 @@ def domain_for(self, client_id: str) -> Optional[str]: try: domain = self._storage.fetch_text(client_id) except ObjectDoesNotExistError: - self.log_debug('Unrecognized client %s', client_id) + self.log_warning('Unrecognized client %s', client_id) return None else: self.log_debug('Client %s has domain %s', client_id, domain) diff --git a/opwen_email_server/services/dns.py b/opwen_email_server/services/dns.py index 3d7ae116..242bfa4b 100644 --- a/opwen_email_server/services/dns.py +++ b/opwen_email_server/services/dns.py @@ -43,10 +43,10 @@ def _run(self, client_name: str, zone: Zone) -> None: try: record = next(record for record in self._driver.iterate_records(zone) if record.name == client_name) except StopIteration: - self.log_debug('No MX records for client %s.%s exist', client_name, zone.domain) + self.log_warning('No MX records for client %s.%s exist', client_name, zone.domain) else: self._driver.delete_record(record) - self.log_debug('Deleted MX records for client %s.%s', client_name, zone.domain) + self.log_info('Deleted MX records for client %s.%s', client_name, zone.domain) class SetupMxRecords(_MxRecords): @@ -59,6 +59,6 @@ def _run(self, client_name: str, zone: Zone) -> None: data=MX_RECORD, ) except LibcloudError: - self.log_debug('MX records for client %s.%s already exist', client_name, zone.domain) + self.log_warning('MX records for client %s.%s already exist', client_name, zone.domain) else: - self.log_debug('Set up MX records for client %s.%s', client_name, zone.domain) + self.log_info('Set up MX records for client %s.%s', client_name, zone.domain) diff --git a/opwen_email_server/services/sendgrid.py b/opwen_email_server/services/sendgrid.py index 48657615..463f6fce 100644 --- a/opwen_email_server/services/sendgrid.py +++ b/opwen_email_server/services/sendgrid.py @@ -70,7 +70,7 @@ def _send_email(self, email: Mail, email_id: str) -> bool: status = getattr(ex, 'code', -1) self.log_exception(ex, 'error sending email %s:%s', email_id, email) else: - self.log_debug('sent email %s', email_id) + self.log_info('sent email %s', email_id) return status in (200, 201, 202) @@ -151,7 +151,7 @@ def _run(self, client_id: str, domain: str) -> None: if not response.ok and response.status_code != 404: response.raise_for_status() - self.log_debug('Deleted mailbox for %s', domain) + self.log_info('Deleted mailbox for %s', domain) class SetupSendgridMailbox(_SendgridManagement): @@ -187,7 +187,7 @@ def _run(self, client_id: str, domain: str) -> None: ) if create_response.ok: - self.log_debug('Set up mailbox for %s', domain) + self.log_info('Set up mailbox for %s', domain) break if retry > self._max_retries: