Releases: bradmkjr/monolog-wordpress
Releases · bradmkjr/monolog-wordpress
More concise fallback error logging when wpdb fails
Improved
- The error message is only logged once per execution, it is adjusted based on the actual WordPress version and the format of the actual fallback logging is more compact as well.
Log into default php error log if database insert fails
Improved
- The handler did not check if inserting the records into the db was successful or not. This could cause important log messages to be lost unnoticed. The handler now logs a warning into the default PHP error log and also logs the failed record there for reference.
More concise fallback error logging when wpdb fails
Improved
- The error message is only logged once per execution, it is adjusted based on the actual WordPress version and the format of the actual fallback logging is more compact as well.
Log into default php error log if database insert fails
Improved
- The handler did not check if inserting the records into the db was successful or not. This could cause important log messages to be lost unnoticed. The handler now logs a warning into the default PHP error log and also logs the failed record there for reference.
More convenient constructor
Improved
- Constructor can now be called without passing the global
$wpdb
, it'll be used by default.
Improved performance when log table size limit is reached
Improved
- The logging table size limiter caused slow logging once the limit was reached, due to the overhead of truncating the table after every row written. This is now fixed by doing the truncations in batches.
Changed
- The
set_max_table_rows()
method is deprecated, useconf_table_size_limiter()
instead. - The
maybe_truncate()
method was not intended to be used outside of the class, so it is not a public method anymore.
More convenient constructor
Improved
- Constructor can now be called without passing the global
$wpdb
, it'll be used by default.
Improved performance when log table size limit is reached
Improved
- The logging table size limiter caused slow logging once the limit was reached, due to the overhead of truncating the table after every row written. This is now fixed by doing the truncations in batches.
Changed
- The
set_max_table_rows()
method is deprecated, useconf_table_size_limiter()
instead. - The
maybe_truncate()
method was not intended to be used outside of the class, so it is not a public method anymore.
New feature to limit the maximum number of rows to keep in the log table
Added
- Feature to limit the maximum number of rows to keep in the log table. Use
set_max_table_rows()
method on the handler instance to configure the limit.
Configure maximum number of rows to keep:
$wordPressHandler->set_max_table_rows( 250000 );
Old entries are deleted when the limit is reached.
Improved
- README.md now has a section about v2 and v1 differences.
Fixed compatibility with Monolog Formatters
Fixed
- Limitations of WordPressHandler regarding formatters, whereas formatted data was only respected in the 'extra' part of the records, but not for 'message' or 'context' (#11).
Note: the time column still does not follow the formatted datetime to keep compatibility with existing deployments.