diff --git a/docs/logging.md b/docs/logging.md new file mode 100644 index 0000000000000000000000000000000000000000..746dd29e62d6f875c00de230bead2a4610f682b4 --- /dev/null +++ b/docs/logging.md @@ -0,0 +1,30 @@ +## Inject logging structure + +The logs for this project are stored on the path specified in `INJECT_LOGS`, +which is set to `backend-logs.jsonl` by default. + +### Format + +The log file contains messages in the JSONL [format](https://jsonlines.org/). +Each message contains these fields: +- `module` - module where this message originates from +- `level` - log level, can be either `INFO`, `WARNING` or `ERROR` +- `date` - timestamp when the message was created +- `lineno` - line number +- `message` - the message text + +### Troubleshooting + +The logs contain quite a few messages and most of them won't be useful to admins for +figuring out why the platform does not behave as expected. +This is because the exercise is quite a complex state machine, +therefore we log all actions that happen during the exercise to help developers replicate bugs. + +However, despite this _all_ `WARNING` and `ERROR` level logs should be considered when checking logs. +These logs might hint at the possible reasons why something does not work. + +### Troubleshooting tips + +- When debugging the process of sending emails with credentials, + you can search for the word `credentials` in the `message` field. + This should return _all_ logs related to sending these emails.