Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
siibra-explorer
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Xiao Gui
siibra-explorer
Commits
cbd69c83
Unverified
Commit
cbd69c83
authored
1 year ago
by
xgui3783
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #1403 from FZJ-INM1-BDA/maint_donotlog
maint: do not log ready endpoint
parents
b66ff5cf
364b90cb
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
backend/app/app.py
+16
-0
16 additions, 0 deletions
backend/app/app.py
backend/app/plugin.py
+1
-1
1 addition, 1 deletion
backend/app/plugin.py
with
17 additions
and
1 deletion
backend/app/app.py
+
16
−
0
View file @
cbd69c83
...
...
@@ -57,3 +57,19 @@ if HOST_PATHNAME:
app
.
mount
(
HOST_PATHNAME
,
_app
)
ready_flag
=
True
DO_NOT_LOGS
=
(
"
/ready
"
,
"
/metrics
"
,
)
import
logging
class
EndpointLoggingFilter
(
logging
.
Filter
):
"""
Custom logger filter. Do not log metrics, ready endpoint.
"""
def
filter
(
self
,
record
:
logging
.
LogRecord
)
->
bool
:
message
=
record
.
getMessage
()
return
all
(
message
.
find
(
do_not_log
)
==
-
1
for
do_not_log
in
DO_NOT_LOGS
)
logging
.
getLogger
(
"
uvicorn.access
"
).
addFilter
(
EndpointLoggingFilter
())
This diff is collapsed.
Click to expand it.
backend/app/plugin.py
+
1
−
1
View file @
cbd69c83
...
...
@@ -64,7 +64,7 @@ def _get_manifest(url: str):
return
return_obj
except
Exception
as
e
:
logger
.
error
(
f
"
Error retrieving:
{
url
}
"
)
logger
.
error
(
f
"
Error retrieving:
{
url
}
,
{
str
(
e
)
}
"
)
@router.get
(
"
/manifests
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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