This assumes you have a fast memory logging system.
error
- Log critical system errors only (not user errors)warn
- Log things that are potential errors or can become errorsinfo
(default) - Logs info about events in the systemdebug
- Log more detailed info about debugging
- Log every request from any API(REST/Kafka/Queues/etc) at info level
- eg request to create a person in your system
- Log all useful unique identifier(Database IDs/kafka offsets)
- Don't log any sensitive data unless approved
- Consider http logging and don't add redundant logging
- If http logging captures everything to debug any issue don't add anything
- Log the outcome of every request at info level
- eg if an applicant was created/merged/scheduled/completed/not completed
- Identifiers should already be logged when the request came in, but add them if needed
- Log every cron job that gets triggered
- Log all useful identifiers and the task being done
- Log the outcome of the cron job
- eg records processed
- Optional detailed/debug logging should be at debug level
- eg request/response payloads/every step of a workflow