Skip to content

Commit

Permalink
Add logging of requests
Browse files Browse the repository at this point in the history
  • Loading branch information
robertdijk authored Mar 8, 2024
1 parent aecef9a commit 5ad5746
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions narrowcast_content/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,9 @@ def check_auth():

if session['token'] not in tokens:
abort(401, "Unauthorized")

@app.after_request
def after_request(response):
timestamp = strftime('[%Y-%b-%d %H:%M]')
logger.error('%s %s %s %s %s %s', timestamp, request.remote_addr, request.method, request.scheme, request.full_path, response.status)
return response

0 comments on commit 5ad5746

Please sign in to comment.