***
Wartungsfenster jeden ersten Mittwoch vormittag im Monat
***
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Invenio Config TUW
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Center for Research Data Management
Invenio Config TUW
Commits
c00544d2
Commit
c00544d2
authored
10 months ago
by
Moser, Maximilian
Browse files
Options
Downloads
Patches
Plain Diff
Rename custom error log formatter
parent
45d42502
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!77
Refactor layout and add tests
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
invenio_config_tuw/logs.py
+2
-2
2 additions, 2 deletions
invenio_config_tuw/logs.py
invenio_config_tuw/startup.py
+2
-2
2 additions, 2 deletions
invenio_config_tuw/startup.py
with
4 additions
and
4 deletions
invenio_config_tuw/
formatter
s.py
→
invenio_config_tuw/
log
s.py
+
2
−
2
View file @
c00544d2
...
@@ -28,7 +28,7 @@ Message:
...
@@ -28,7 +28,7 @@ Message:
"""
"""
class
Custom
Formatter
(
Formatter
):
class
Detailed
Formatter
(
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
)
This diff is collapsed.
Click to expand it.
invenio_config_tuw/startup.py
+
2
−
2
View file @
c00544d2
...
@@ -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
.
formatter
s
import
Custom
Formatter
from
.
log
s
import
Detailed
Formatter
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
(
Custom
Formatter
())
mail_handler
.
setFormatter
(
Detailed
Formatter
())
# attach to the application
# attach to the application
app
.
logger
.
addHandler
(
mail_handler
)
app
.
logger
.
addHandler
(
mail_handler
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment