You are here

function JsonLogData::__construct in JSONlog 8.2

Same name and namespace in other branches
  1. 8 src/Logger/JsonLogData.php \Drupal\jsonlog\Logger\JsonLogData::__construct()
  2. 3.x src/Logger/JsonLogData.php \Drupal\jsonlog\Logger\JsonLogData::__construct()

JsonLogData constructor.

Parameters

string $site_id:

string $canonical:

File

src/Logger/JsonLogData.php, line 52

Class

JsonLogData

Namespace

Drupal\jsonlog\Logger

Code

function __construct($site_id, $canonical) {
  $this->trunc = '';
  $this->message_id = uniqid($site_id, TRUE);
  $this->site_id = $site_id;
  $this->canonical = $canonical;
  $this->type = 'drupal';
  $this->{'@version'} = 1;
  $this
    ->setTimestamp();
}