Skip to content
Bastian Feder edited this page Dec 28, 2010 · 1 revision

Since the data import is a headless process there is no way to track its behavior in a continuously, automated running environment. Therefore the logging was introduced. The current implementation of the logger is abstracted by the method log() in the ImporterBase class.

Configuration

Since the logging functionality is provided by SF2 by default there is no special configuration (as in xml/php/yaml files) necessary. Just pass the @logger service as an argument to your service.

Example of a yaml configuration:

service:

import.importer.faz.books: class: Application\ImportBundle\Importer\Faz\ImporterFazBooks arguments: - http: method: POST server_vars: content_type: text\/xml; charset=utf-8 xml: schema_file: ~ article: publisher: Frankfurter Allgemeine Zeitung GmbH jackalope: root_path: /feeds/faz/books article_path: article meta_path: metaData - @jackalope - @?logger

Synopsis

log( (string) $message, (string) $level = 'debug' );

Defined by the LoggerInterface there as a number of log priorities available. Listed by ascending priority ($level), these are:

  • debug
  • info
  • notice
  • emerg
  • alert
  • error
  • crit
  • warn In case a priority was not defined by the LoggerInterface an InvalidArgumentException will be thrown.
Clone this wiki locally