Skip to content

Commit

Permalink
Merge pull request #55 from geoadmin/develop
Browse files Browse the repository at this point in the history
New Release v3.1.2 - #patch
  • Loading branch information
ltshb authored Aug 29, 2022
2 parents 22ab19e + 876d8ae commit 3608614
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 113 deletions.
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name = "pypi"

[packages]
boto3 = "~=1.23.0"
logging-utilities = "~=2.0.0"
logging-utilities = "~=3.0"
Flask = "~=2.1.0"
gevent = "~=21.12.0"
gunicorn = "~=20.1.0"
Expand Down
150 changes: 75 additions & 75 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ def log_response(response):
"status_code": response.status_code,
"headers": dict(response.headers.items()),
"json": response.json,
"duration": time.time() - g.get('request_started', time.time())
}
},
"duration": time.time() - g.get('request_started', time.time())
}
)
return response
Expand Down
50 changes: 15 additions & 35 deletions logging-cfg-local.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@ loggers:
level: DEBUG
handlers:
- console
- file-standard
- file-json
gunicorn.access:
level: DEBUG
handlers:
- console
- file-standard
- file-json
botocore:
level: INFO
boto3:
Expand All @@ -46,7 +50,9 @@ formatters:
standard:
format: "[%(asctime)s] %(levelname)-8s - %(name)-26s : %(message)s"
verbose:
format: "[%(asctime)s] %(levelname)-8s - %(name)-26s : %(message)s : path=%(flask_request_path)s headers=%(flask_request_headers)s payload=%(flask_request_json)s"
(): logging_utilities.formatters.extra_formatter.ExtraFormatter
format: "[%(asctime)s] %(levelname)-8s - %(name)-26s : %(message)s"
extra_fmt: " : path=%(flask_request_path)s headers=%(flask_request_headers)s payload=%(flask_request_json)s"
json:
(): logging_utilities.formatters.json_formatter.JsonFormatter
add_always_extra: False
Expand All @@ -70,43 +76,17 @@ formatters:
excInfo: exc_info
request:
id: flask_request_headers.X-Amz-Cf-Id
path: flask_request_path
method: flask_request_method
queryString: flask_request_query_string
headers:
Content-Type: flask_request_headers.Content-Type
Content-Length: flask_request_headers.Content-Length
Cloudfront-Forwarded-Proto: flask_request_headers.Cloudfront-Forwarded-Proto
Content-Encoding: flask_request_headers.Content-Encoding
Origin: flask_request_headers.Origin
Referer: flask_request_headers.Referer
Accept: flask_request_headers.Accept
Accept-Encoding: flask_request_headers.Accept-Encoding
Accept-Language: flask_request_headers.Accept-Language
User-Agent: flask_request_headers.User-Agent
If-None-Match: flask_request_headers.If-None-Match
Sec-Fetch-Mode: flask_request_headers.Sec-Fetch-Mode
Sec-Fetch-Site: flask_request_headers.Sec-Fetch-Site
Sec-CH-UA: flask_request_headers.Sec-CH-UA
Sec-CH-UA-Mobile: flask_request_headers.Sec-CH-UA-Mobile
Sec-CH-UA-Platform: flask_request_headers.Sec-CH-UA-Platform
Sec-CH-UA-Model: flask_request_headers.Sec-CH-UA-Model
remoteAddr: flask_request_remote_addr
path: "%(flask_request_path)s"
method: "%(flask_request_method)s"
queryString: "%(flask_request_query_string)s"
headers: flask_request_headers.
remoteAddr: "%(flask_request_remote_addr)s"
payload: "%(flask_request_json).128s"
response:
statusCode: response.status_code
headers:
Cache-Control: response.headers.Cache-Control
Expires: response.headers.Expires
Content-Type: response.headers.Content-Type
Content-Length: response.headers.Content-Length
Content-Encoding: response.headers.Content-Encoding
Access-Control-Allow-Headers: response.headers.Access-Control-Allow-Headers
Access-Control-Allow-Methods: response.headers.Access-Control-Allow-Methods
Access-Control-Allow-Origin: response.headers.Access-Control-Allow-Origin
ETag: response.headers.ETag
duration: response.duration
payload: "%(response.payload).128s"
headers: response.headers.
duration: "%(duration)s"
payload: "%(response.json).128s"
message: message

handlers:
Expand Down

0 comments on commit 3608614

Please sign in to comment.