Plugin developers: what do you actually log in production?
I’ve been thinking about production logging in WordPress plugins lately.
During development it’s tempting to log everything because more context makes debugging easier. In production though, that gets uncomfortable pretty quickly.
Things like request payloads, webhook bodies, order IDs, user IDs, API responses and stack traces can be extremely useful when something fails, but they can also create privacy, storage and retention problems if you keep too much.
I’m curious where other plugin developers draw the line.
For example, do you:
- log full external API responses or only selected fields?
- keep business identifiers like order IDs in logs?
- redact emails, names and payment-related data by default?
- use different retention periods for debug logs vs audit/history data?
- let merchants enable verbose logging temporarily?
- automatically delete old logs?
I’m especially interested in plugins where failures may only become visible hours or days later, so having enough context to reconstruct what happened actually matters.
What has worked well for you in production without turning the log table into a second database?