Prestashop Logger :: addLog()在哪里保存日志文件?

编程入门 行业动态 更新时间:2024-10-09 14:24:35
本文介绍了Prestashop Logger :: addLog()在哪里保存日志文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在Prestashop模块中遇到了以下一行:

I came across the following line in a Prestashop module:

Logger::addLog('2: md5 string is '.$md5HashData, 1);

日志保存在哪里?

推荐答案

日志保存在数据库中的日志"表中(使用您的当前前缀);

The log is saved in database in 'log' table (with your current prefix);

您可以从 classes/Logger.php

You can find the addLogg function from classes/Logger.php

但是,没有文档,您可以从方法注释中找到有用的东西

However there is no documentation you can find something useful from method comment

/** * add a log item to the database and send a mail if configured for this $severity * * @param string $message the log message * @param int $severity * @param int $error_code * @param string $object_type * @param int $object_id * @param boolean $allow_duplicate if set to true, can log several time the same information (not recommended) * @return boolean true if succeed */ public static function addLog($message, $severity = 1, $error_code = null, $object_type = null, $object_id = null, $allow_duplicate = false)

据我从代码中了解,如果第二个参数小于5(配置"表中PS_LOGS_BY_EMAIL的值),您还应该收到包含警告消息的电子邮件.但是它只会被发送和记录一次(如果该方法的最后一个参数$ allow_duplicate不为真)

As I understand from the code if the second parameter would be less than 5 (value of PS_LOGS_BY_EMAIL from 'configuration' table) you should also receive email with the alert message. But it will be sent and logged only once (if last parameter $allow_duplicate of the method wouldn't be true)

注意:这在Prestashop 1.6中已更改,该类现在称为PrestaShopLogger,请改用PrestaShopLogger::addLog($message, $severity);.它们显示在后台的Advanced Settings > Logs下.

Note: This has changed in Prestashop 1.6, the class is now called PrestaShopLogger, use PrestaShopLogger::addLog($message, $severity); instead. They are shown in the backoffice, under Advanced Settings > Logs.

更多推荐

Prestashop Logger :: addLog()在哪里保存日志文件?

本文发布于:2023-11-26 07:47:47,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1633248.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件   日志   Prestashop   Logger   addLog

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!