Prestashop-如何写入日志文件? [英] Prestashop - how do I write to a log file?
本文介绍了Prestashop-如何写入日志文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我应该在Prestashop模块中使用什么php代码写入日志文件?我用过
What php code should I use in a Prestashop module to write to a log file? I have used
Logger::addLog("something",1);
但它不起作用.
推荐答案
您还可以使用以下代码将日志存储在文件中.
You can also store the log in file using below code.
$logger = new FileLogger(0); //0 == debug level, logDebug() won’t work without this.
$logger->setFilename(_PS_ROOT_DIR_."/log/debug.log");
$logger->logDebug("message 1″);
$logger->logDebug("message 2″);
它将起作用!
谢谢
这篇关于Prestashop-如何写入日志文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文