-
Notifications
You must be signed in to change notification settings - Fork 4
Log Handlers
A Query Monitor handler allows piping to the query monitor on the page, providing helpful debug information about the current WordPress request.
Send a log to a WordPress Log Post Type to be viewed globally across the WordPress installation.
In order to prevent multiple log entries from being written to the database (especially on high volume sites), each unique log entry is limited to one per 15 minutes. A log entry is considered unique if it has the same $key
(Title) and $args['context']
.
The exception to this rule is if WP_DEBUG
is set to true
, in which case, every log entry will be recorded and throttling is disabled.
Log entries with a level of info
will only be written to the database if WP_DEBUG
is true
The plugin includes Monolog Handlers for logging directly to a Post's or Term's meta. By logging to a object's meta, you can drill down into specific events that relate to the object very quickly. Both handlers require the additional $object_id
and optional $log_key
parameters on the handler's constructor.
Pipe the log record directly to the WP-CLI output.
Forward the log to a catchable exception AI_Logger\Handler\Handler_Exception
. Only emergency, alert, and critical events will thrown an exception.
Logs will be appended to a post's meta for review.
ai_logger_to_post( $post_id, 'meta-key' )->info( 'This will log to the <meta-key> for a specific post.' );
Logs will be appended to a term's meta for review.
ai_logger_to_term( $term_id, 'meta-key' )->info( 'This will log to the <meta-key> for a specific term.' );
ai_logger_to_qm()->info( 'This will show up in Query Monitor!' );