From 757f9bc5b3b8afb7554638230387cb689b83cce9 Mon Sep 17 00:00:00 2001 From: Robert Keyser Date: Thu, 9 Feb 2023 16:15:22 -0600 Subject: [PATCH 1/5] round handler_time to 3 decimal places --- src/fides/api/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fides/api/main.py b/src/fides/api/main.py index 88400cbcc06..b3f98e6b5d3 100644 --- a/src/fides/api/main.py +++ b/src/fides/api/main.py @@ -296,7 +296,7 @@ async def log_request(request: Request, call_next: Callable) -> Response: logger.bind( method=request.method, status_code=response.status_code, - handler_time=f"{handler_time.microseconds * 0.001}ms", + handler_time=f"{round(handler_time.microseconds * 0.001,3)}ms", path=request.url.path, ).info("Request received") return response From 69e2d70d35b43f0ccf777c2248a9fe8f380bd92f Mon Sep 17 00:00:00 2001 From: Robert Keyser Date: Thu, 9 Feb 2023 16:24:36 -0600 Subject: [PATCH 2/5] log Fides version at startup --- src/fides/api/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fides/api/main.py b/src/fides/api/main.py index b3f98e6b5d3..d9eaebe7f73 100644 --- a/src/fides/api/main.py +++ b/src/fides/api/main.py @@ -215,7 +215,7 @@ async def prepare_and_log_request( @app.on_event("startup") async def setup_server() -> None: "Run all of the required setup steps for the webserver." - + logger.info(f"Starting Fides - {VERSION}") logger.warning( "Startup configuration: reloading = {}, dev_mode = {}", CONFIG.hot_reloading, From 48d3f841497e7a7f5683832d0bf9cd5443fd8f3f Mon Sep 17 00:00:00 2001 From: Robert Keyser Date: Thu, 9 Feb 2023 16:25:23 -0600 Subject: [PATCH 3/5] change log level of startup messages to INFO --- src/fides/api/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fides/api/main.py b/src/fides/api/main.py index d9eaebe7f73..9b6d6f5f3e8 100644 --- a/src/fides/api/main.py +++ b/src/fides/api/main.py @@ -216,12 +216,12 @@ async def prepare_and_log_request( async def setup_server() -> None: "Run all of the required setup steps for the webserver." logger.info(f"Starting Fides - {VERSION}") - logger.warning( + logger.info( "Startup configuration: reloading = {}, dev_mode = {}", CONFIG.hot_reloading, CONFIG.dev_mode, ) - logger.warning("Startup configuration: pii logging = {}", CONFIG.logging.log_pii) + logger.info("Startup configuration: pii logging = {}", CONFIG.logging.log_pii) if CONFIG.logging.level == DEBUG: logger.warning( From 4d74da2a79fdc9fba9a616ff4bf09346e77b9cb8 Mon Sep 17 00:00:00 2001 From: Robert Keyser Date: Thu, 9 Feb 2023 16:39:37 -0600 Subject: [PATCH 4/5] Changelog update for logging improvements --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 08aa9b14a64..a25c7cb01ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ The types of changes are: * Added config properties to override database Engine parameters [#2511](https://github.com/ethyca/fides/pull/2511) * Increased default pool_size and max_overflow to 50 [#2560](https://github.com/ethyca/fides/pull/2560) +* Log Fides version at startup [#2566](https://github.com/ethyca/fides/pull/2566) * Admin UI * Create custom fields from a resource screen - Button to Trigger modal [#524](https://github.com/ethyca/fides/pull/2536) @@ -35,6 +36,7 @@ The types of changes are: * Update Admin UI to show all action types (access, erasure, consent, update) [#2523](https://github.com/ethyca/fides/pull/2523) * Removes legacy `verify_oauth_client` function [#2527](https://github.com/ethyca/fides/pull/2527) * Updated the UI for adding systems to a new design [#2490](https://github.com/ethyca/fides/pull/2490) +* Minor logging improvements [#2566](https://github.com/ethyca/fides/pull/2566) ### Fixed From c056e37ace41511be966000ed24b88dcc1292a7e Mon Sep 17 00:00:00 2001 From: Robert Keyser <39230492+RobertKeyser@users.noreply.github.com> Date: Thu, 16 Feb 2023 11:00:08 -0600 Subject: [PATCH 5/5] add v to version Co-authored-by: Thomas --- src/fides/api/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fides/api/main.py b/src/fides/api/main.py index 9b6d6f5f3e8..6bc9e1ca203 100644 --- a/src/fides/api/main.py +++ b/src/fides/api/main.py @@ -215,7 +215,7 @@ async def prepare_and_log_request( @app.on_event("startup") async def setup_server() -> None: "Run all of the required setup steps for the webserver." - logger.info(f"Starting Fides - {VERSION}") + logger.info(f"Starting Fides - v{VERSION}") logger.info( "Startup configuration: reloading = {}, dev_mode = {}", CONFIG.hot_reloading,