Skip to content

Commit

Permalink
Merge pull request #46 from geoadmin/bug-logging-level
Browse files Browse the repository at this point in the history
Normalized routes logging
  • Loading branch information
ltshb authored Apr 4, 2022
2 parents 038ee7a + c681cd8 commit c732afb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from app.settings import CACHE_CONTROL_4XX

logger = logging.getLogger(__name__)
logger_routes = logging.getLogger('app.routes')

# Standard Flask application initialisation

Expand All @@ -29,7 +30,7 @@
@app.before_request
def log_route():
g.setdefault('request_started', time.time())
logger.info('%s %s', request.method, request.path)
logger_routes.debug('%s %s', request.method, request.path)


# Add CORS Headers to all request
Expand Down Expand Up @@ -79,7 +80,7 @@ def validate_origin():

@app.after_request
def log_response(response):
logger.info(
logger_routes.info(
"%s %s - %s",
request.method,
request.path,
Expand Down

0 comments on commit c732afb

Please sign in to comment.