Search

Page tree
Skip to end of metadata
Go to start of metadata


Introduction

In order to be able to reproduce the cause of potential errors, eZ Commerce uses Monolog to keep track of the most important information. The standard implementation writes standard shop-related information into a single log file. Mails and ERP communication are written into the database, in order to make it easier to process them for administrative (HTML-)presentation.

The purpose of this part of the documentation is to describe what has been implemented and to show which steps are necessary to create customized logging.

GDPR

Some logs can conatin personal informations which can be affected by the GDPR regulations.

By default eZ Commerce does not log the user-id for logging search query. 

siso_core.default.gdpr.store_user_id_in_logs: false


Important terms used in this document

 Monolog

Monolog is a PHP library for logging. It provides classes and interfaces in order to implement basic and more sophisticated logging set-ups. It is also very easy to extend the base implementations of Monolog with its concept of Loggers, Handlers, Processors and Formatters. The basic documentation of these features is not in the scope of this document. Please refer to the Monolog documentation for an introduction.

 Log record

A (Mono)log record is a structured set of data that represents a single log entry. For Monolog, it is an array that contains the elements: message, level, datetime, channel, context and extra.

 Log type

A log type or log entity describes log records, which have certain data elements in common. For example: all logged ERP messages include in context (among other): measuring_point, message_identifier.

 Doctrine
Doctrine is a PHP package which abstracts database access and provides object relational mapping (i.e. connecting class-objects to database-results). More information can be found at the official documentation and the respective Symfony book and cookbook.
 ERP

 

ERP (Enterprise resource planning) is business management software—typically a suite of integrated applications—that a company can use to collect, store, manage and interpret data from many business activities, including:

Source: Wikipedia

Known ERP software packages:

  • Microsoft Dynamics NAV (former navision)
  • Microsoft Dynamics AX
  • SAP

 


Related documents

Please keep in mind that Logging is really connected with a lot of different modules in our shop. Be sure to check these out:

Table of contents:


Children pages:


FAQ

Frequently Asked Questions

 Which log entries are stored in the DB?

By default ERP messages and emails are stored in the DB.

All other log entries are stored in the .log file.

 I'm getting an error, that some *log* database tables couldn't be found.

Please update your database schema

Command line example
php bin/console doctrine:schema:update [--dump-sql|--force]
 I need to log additionally missing translations (or something else) to the DB. What should I do?

If you need to extend the logging with a new DB log record, please read the cookbook.

 How do I invoke a simple log instruction

The ID for the standard logging is 'silver_common.logger'. This is an instance of Monolog\Logger. Thus, writing a simple debug log in a container action is like:

$logger = $this->get('silver_common.logger');
$additionalContext = array('exception' => $ex);
$logger->debug('My log message', $additionalContext);
 I want to log a new created ERP message. How do I do that?

All transmitted messages are logged automatically, because the mandatory transport layer implicitly logs all messages. But if a new transport is implemented (other than the WebConnectorMessageTransport), this implementation hast to take care of logging measuring point a lower level. Please read the chapter Measuring Points in the ERP logging documentation.

 How do I log an email that is sent by the shop?
All emails, which are sent using the MailHelperService, are logged implicitly.
 How can I avoid, that the password will be logged in the DB?

If the email contains a password, that should not be logged in the DB, you have to specify this password as a template parameter.

MailHelperService will replace the template parameter 'password' with '***'.

 Where can I find the log file?

 The standard log file is (relative to the shop's root directory) located at var/logs/silver.eshop.log

More precisely, Monolog's StreamHandler is responsible for writing logs into files. The path the destined file is a constructor parameter of the StreamHandler. For an example service configuration, please have a look at the ERP Logging.

Templating

There are no templates for logging.


Cookbook

Logging Cookbook For Database Logging


API

Logging - API

  • No labels