diff options
author | Munyoki Kilyungi | 2022-08-29 12:32:05 +0300 |
---|---|---|
committer | Munyoki Kilyungi | 2022-08-29 12:32:05 +0300 |
commit | 185ab8cc3e621f3257b525a8ca5ae7a2281d055e (patch) | |
tree | a0205d22fcd5d8e945f2fa4e4b46e5c8ebaa7be3 | |
parent | a6299a491b89d45c5d43d4044ecdc2e5e351cfdd (diff) | |
download | gn-gemtext-185ab8cc3e621f3257b525a8ca5ae7a2281d055e.tar.gz |
Update topic on better logging.
* topics/better-logging.gmi: Update design-doc.
-rw-r--r-- | topics/better-logging.gmi | 44 |
1 files changed, 11 insertions, 33 deletions
diff --git a/topics/better-logging.gmi b/topics/better-logging.gmi index ea9fd26..8de3fb3 100644 --- a/topics/better-logging.gmi +++ b/topics/better-logging.gmi @@ -6,44 +6,22 @@ We prioritise maintaining user functionality over speed in GN [with time this sp ## Goals -- Have script-friendly error/info logs. - -- Remove noise from GN2. - -- Separate logging into different files: error logs, info logs. Add this somewhere with Flask itself instead of re-directing STDOUT to a file. +* Have script-friendly error/info logs. +* Remove noise from GN2. +* Separate logging into different files: error logs, info logs. Add this somewhere with Flask itself instead of re-directing STDOUT to a file. ### Non-goals -- Logging in GN3. - -- Parsing logs to extract goals. - -- Getting rid of "gn.db" global object and in so doing removing "MySqlAlchemy" [that we really shouldn't be using]. - -- Adding log messages to existing functions. +* Logging in GN3. +* Parsing logs to extract goals. +* Getting rid of "gn.db" global object and in so doing removing "MySqlAlchemy" [that we really shouldn't be using]. +* Adding log messages to existing functions. ## Actual Design -- Configure logger to separate logs into different files: - - - INFO file - contains initial bootstrap messages and instrumentation we may have to do. - - - ERROR file - contains real errors. - -- Have those settings - the different log files - be part of GN2 start-up script. - -- For error messages, use the following format for different error messages: - - - "DATABASE: <message>" - - - "REDIS: <message>" - - - "COMPUTATION: <message>" - - - "API: <message>" - - - "MISC: <message>" +* Get rid of "utility.logger" module and replace it with Flask's or Python's in-built logging. +* Configure the logging system to automatically add the module name, line number, time-stamps etc. -- Have time-stamped logs by month. E.g. "genenetwork2-08-2022.error.log" and "genenetwork2-08-2022.info.log". This way in future, we can actually run an analysis on what breaks often in GN2. +## Resources -- Get rid of "utility.logger" module and replace it with Flask's or Python's in-built logging. +=> https://realpython.com/python-logging/ Logging in Python |