Skip to main content

The HikaShop log records what happens in the background of your shop: the notifications sent by the payment providers, the requests of the shipping methods, and the errors HikaShop meets, such as an email that could not be sent. When a payment is not confirmed or a shipping price is missing, it is the first place to look.

Payment and shipping methods only write to the log when the Debug option of their settings is on. Turn it on while you look into a problem, and off again afterwards.

Where to find it

Go to System > Logs in the HikaShop menu. On an order page, the Logs (n) link next to the History title opens the entries of that order.

The listing

Each line is one entry, newest first, with:

  • Date: when it was written. Click it to open the entry.
  • Level: Debug, Info, Warning or Error.
  • Source: the payment method, shipping method or plugin that wrote it, or the part of HikaShop (mail, vat, import...). Click it to see only that source.
  • Message: the beginning of the text. A paperclip and a size mean the entry holds more data, shown on its page.
  • Order: the order the entry is about, when known, with a link to it.
  • IP address: of the visitor or of the server that made the request. A payment notification comes from the provider's servers.

The search box looks in the messages, the data, the sources, the addresses and the IP addresses, and finds the entries of an order by its number and those of one request by its id. The links to the entries of an order or of a request, on the order page and on the page of an entry, fill this search in. The Filter options button shows the filters: source, type (payment, shipping, plugin, HikaShop), minimum level and dates. The columns can be sorted by clicking their titles.

An entry

The page of an entry shows everything about it: the address that was called, the customer, and the full data, for example the content of a notification sent by the payment provider. The Copy button copies the data, to paste it in a message to the provider's or to our support. Wrap lines folds long lines.

Under the data, Entries of the same request lists the other entries written while the same page or notification was processed, in order. Reading them together usually tells the whole story of a payment notification.

Export and deletion

  • Export (CSV) downloads the entries matching the current search and filters, to open in a spreadsheet.
  • Export (text) downloads the same entries as a text file, the format to send to a support team.
  • Delete deletes the ticked entries.
  • Clear the log deletes all the entries; with a search or filters active, it becomes Delete the filtered entries and only deletes the entries they match, on every page. The count is shown in the confirmation.

Settings

In System > Configuration > Main > Files:

  • Logs: in the database (the System > Logs page, recommended), in a file, or both.
  • Keep the log entries for (days): 30 by default. Older entries are removed by the HikaShop cron, and when the Logs page is opened. At most 200,000 entries are kept.
  • Log file: the file used when the Logs setting includes a file.

Card numbers, security codes, passwords, secret keys and access tokens found in the data are replaced with *** before they are written.

The log file of older versions

Before HikaShop 6.8.0 the log was a file, shown in a popup of the configuration. After the update, the new entries go to the Logs page, and the Logs page shows a notice while the old file still exists, with buttons to download it and to delete it.

From the command line

The log can be read without the backend, for example over SSH: hikashop:log:list lists the entries (with the same filters as the page: --source, --type, --level, --order, --request, --since, --until, --search), hikashop:log:get shows one entry with its data, and hikashop:log:clear deletes the entries matching the filters. On Joomla, run them with php cli/joomla.php, on WordPress with wp hikashop log list, wp hikashop log get and wp hikashop log clear. They work in every edition. The connector API offers the same reading with GET /logs and GET /logs/{id}.

For developers

hikashop_writeToLog($data, $name) still works as before and writes an Info entry, $name being the source. A payment plugin's $this->writeToLog($data) also records the order it loaded. To choose the level or give the order, use hikashop_log($message, $context), with $context an array of: level (debug, info, warning or error), source, type (payment, shipping, plugin or core), order_id and data (an array, an object or a text, shown on the entry's page). An exception can be given as the message.