Knowing what happened.
WHY LOGGING MATTERS
You cannot watch a hosted application run.
The log is the only record.
WHAT TO LOG
Startup and configuration loaded Significant actions Errors, with enough context to diagnose Timing of slow operations
WHAT NOT TO LOG
Passwords and keys Full personal data Every routine action, at volume
THAT LAST POINT
Excessive logging fills disk and obscures what matters.
WHAT TO USE
Python's logging facilities, rather than printing.
WHY
Levels, formatting and destinations are controlled centrally.
WHAT LEVELS ARE FOR
Distinguishing routine information from warnings and errors.
WHAT TO SET IN PRODUCTION
A level that records what you need without excessive volume.
WHERE LOGS GO
The application's log, accessible through cPanel.
WHAT TO CHECK
After every deployment When anything is reported wrong
WHAT TO ROTATE
Log files, so they do not grow without limit.
WHAT TO INCLUDE IN EVERY ERROR LOG ENTRY
What failed, with what input, and when.