Logger class, powered by KLogger, enables the functionality of logging messages, errors and debugging values in log files.

Log files are located at the logs folder located at your template’s root and it is created on its first execution.


Add the use statement at the beginning of your php file and call the Log class:

use Amostajo\WPPluginCore\Log;

Logging a message

Log::info( 'my message' );

Debugging a value

Supported data types as value parameters are: string, numeric and array.

Log::debug( 'Selected users', $users );

Logging an error

Log::error( $error );

Logging an exception

Log::error( $exception );


Logger can be configured in the template’s configuration file.