*** Wartungsfenster jeden ersten Mittwoch vormittag im Monat ***

Skip to content
Snippets Groups Projects
Commit c00544d2 authored by Moser, Maximilian's avatar Moser, Maximilian
Browse files

Rename custom error log formatter

parent 45d42502
Branches
Tags
1 merge request!77Refactor layout and add tests
...@@ -28,7 +28,7 @@ Message: ...@@ -28,7 +28,7 @@ Message:
""" """
class CustomFormatter(Formatter): class DetailedFormatter(Formatter):
"""Custom logging formatter that provides more details.""" """Custom logging formatter that provides more details."""
def __init__(self, fmt=custom_format, **kwargs): def __init__(self, fmt=custom_format, **kwargs):
...@@ -50,4 +50,4 @@ class CustomFormatter(Formatter): ...@@ -50,4 +50,4 @@ class CustomFormatter(Formatter):
record.user_id = None record.user_id = None
record.request_url = None record.request_url = None
return super(CustomFormatter, self).format(record) return super().format(record)
...@@ -18,7 +18,7 @@ from logging.handlers import SMTPHandler ...@@ -18,7 +18,7 @@ from logging.handlers import SMTPHandler
from invenio_rdm_records.services.search_params import MyDraftsParam from invenio_rdm_records.services.search_params import MyDraftsParam
from .formatters import CustomFormatter from .logs import DetailedFormatter
def register_smtp_error_handler(app): def register_smtp_error_handler(app):
...@@ -68,7 +68,7 @@ def register_smtp_error_handler(app): ...@@ -68,7 +68,7 @@ def register_smtp_error_handler(app):
) )
mail_handler.name = handler_name mail_handler.name = handler_name
mail_handler.setLevel(ERROR) mail_handler.setLevel(ERROR)
mail_handler.setFormatter(CustomFormatter()) mail_handler.setFormatter(DetailedFormatter())
# attach to the application # attach to the application
app.logger.addHandler(mail_handler) app.logger.addHandler(mail_handler)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment