nortmas
9/27/2017 - 2:45 PM

Logger

<?php
// Defines a factory for logging channels.

/** @var \Drupal\Core\Logger\LoggerChannelFactory $logger */
$logger = \Drupal::service('logger.factory');
$logger_channel = $logger->get('module_name');
// notice, warning, info
$logger_channel->error('Error @error!', ['@error' => $error]);