PrestaShop: add log

Trabla: PrestaShop: add log


Solving:

1. PrestaShop logs are stored in database - table ps_log

2. Logger class defined in :
../prestashop/classes/Logger.php


3. Use in code:

$message = 'This is my test log, my_var  = '.$my_var;
Logger::addLog( $message, 1);

4. Example select from log table (last 10 records):
SELECT * FROM ps_log ORDER BY id_log DESC LIMIT 10;

No comments:

Post a Comment