Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 1076 Vote(s) - 3.43 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Where does Prestashop Logger::addLog() save the log file?

#1
I came across the following line in a Prestashop module:

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

Where is the log saved?
Reply

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

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

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)

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)

**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`.

[1]:

[To see links please register here]

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through