Opened 2 years ago
Last modified 2 years ago
#16107 new defect (bug)
WordPress Database Error Logging Extravaganza
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | Database | Version: | 3.0.4 |
| Severity: | normal | Keywords: | has-patch |
| Cc: |
Description
If PHP error logging is enabled, the wordpress database class will log errors to file by using the error_log() function. This is a PHP function.
While doing so, it does not reflect the PHP configuration setting for log_errors_max_len which defaults to 1024 (bytes).
While not doing so, the database class can log extremely long queries into the file creating multiple gigabytes quite quickly.
Attachments (2)
Change History (6)
comment:2
hakre
— 2 years ago
FYI: I had a single error reporting line that was 21.7 MB, the whole file about 2.4 GB within less than a week. It's basically because of a large option value, which seems valid to me by database definition as those are LONGTEXT (L + 4 bytes, where L < 232) so somewhat up to 4 GB is available for each option value if I'm correct (WP limits this to 256MB in the admin).
comment:3
follow-up:
↓ 4
westi
— 2 years ago
- Milestone changed from Awaiting Review to Future Release
I'm not sure we should even call error_log for these really IMHO.
I think it is probably better to have a hook for a plugin to do this if it really wants to.
comment:4
in reply to:
↑ 3
hakre
— 2 years ago
Replying to westi:
I'm not sure we should even call error_log for these really IMHO.
I think it is probably better to have a hook for a plugin to do this if it really wants to.
error_log is plugable by php config, you can find more in the php manual. That probably asks both of the questions you triggered with your comment.
Patch for single site installations.