0

how can I access to php logs using plugin ? I would like in my plugin to show logs, in case there will be some error user can easily check log and send me it.

1

If you have Try and cache block and loggin error manually than you can try this :

$mylogfilepath = plugin_dir_path(__FILE__).'debug.log';
$errormessage = 'SOME ERROR'.PHP_EOL;
error_log($errormessage, 3, $mylogfilepath);

Place debug.log file directly inside your plugin. and it will log error to that file. third attribute in error_log set path of file in which log should be recored.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.