Skip to content

Front end Logging

Sean Fisher edited this page Jan 14, 2021 · 2 revisions

Javascript logging can be enabled to allow logs to be collected from the front-end.

Enabling

add_filter( 'ai_logger_enable_js_logging', '__return_true' );

Usage

window.aiLogger = window.aiLogger || [];
window.aiLogger.push(['log message', { argumentsToInclude: 'value' }]);

The system will include additional information about the current request (such as the URL, current user, etc.) by default. Pass the window.aiLogger array on the page a log message and arguments to store.

Clone this wiki locally