diff options
author | John Nduli | 2024-06-11 17:15:20 +0300 |
---|---|---|
committer | BonfaceKilz | 2024-06-11 20:12:33 +0300 |
commit | c604a9696abcde65af458191858fdff2432615bd (patch) | |
tree | 1a3e2ce4e2d1e43862ed9e9ec12e840a0d2b8329 /issues/logging_handler_improvements_gn3.gmi | |
parent | c7e577cdaf5110d9737d697d8fbcb9d7e8f64bf3 (diff) | |
download | gn-gemtext-c604a9696abcde65af458191858fdff2432615bd.tar.gz |
docs: isse for logging handler
Diffstat (limited to 'issues/logging_handler_improvements_gn3.gmi')
-rw-r--r-- | issues/logging_handler_improvements_gn3.gmi | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/issues/logging_handler_improvements_gn3.gmi b/issues/logging_handler_improvements_gn3.gmi new file mode 100644 index 0000000..0328f3b --- /dev/null +++ b/issues/logging_handler_improvements_gn3.gmi @@ -0,0 +1,41 @@ +# Logging Handler Improvements for GN3 + +## Tags + +* assigned: jnduli +* priority: low +* type: enhancement + +## Goal + +Our logs help us fix problems without the need for LOG_LEVEL=DEBUG + +## Background + +When fixing logs in our database_connection + +=> https://github.com/genenetwork/genenetwork3/pull/167 related PR + +I realized that our logs don't provide enough context to debug and fix problems. + +Also looking at the code in gn3 + +=> https://github.com/jnduli/genenetwork3/blob/8e4c5eefaa8d02b10d0d0a38ac81718a7cadf231/gn3/loggers.py#L16 gn3 log set up control + +We only provide StreamHandler which I still don't understand how it links up to the overall logging infrastructure. + +## Proposal + +* Change our FORMAT message to provide more context for failures i.e. use "%(levelname)s:%(name)s:%(pathname)s:%(funcName)s:%(asctime)s:%(message)s" + +=> https://docs.python.org/3/library/logging.html#logrecord-attributes ref for attributes + +* Add extra handlers that help easily parse and store errors permanently. Piping the StreamHandler to a file may still help and work here. Storing the logs in a file supports some nice future features that may help with maintentance. + +* Build a tool that can parse and search through the log files looking for `ERROR`s. This helps us with early detection of potential problems instead of waiting for users to complain about this. This means attempting to be more detailed on our logs. A potential improvement would be to log our errors in gn3's error logging code meaning we have user failures in our code. + +=> https://github.com/jnduli/genenetwork3/blob/8e4c5eefaa8d02b10d0d0a38ac81718a7cadf231/gn3/errors.py#L1 suggestion for where to add more error logs + +* Log rotation strategy? + +* Infrastructure for managing logs? I'm familiar with ELK. |