Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/2624848 event system watchdog entry #297

Closed
wants to merge 20 commits into from
Closed

Feature/2624848 event system watchdog entry #297

wants to merge 20 commits into from

Conversation

ndf
Copy link
Contributor

@ndf ndf commented Nov 28, 2015

https://www.drupal.org/node/2624848

Thisi s pull-request for discussion. Sitting now with klausi

@ndf
Copy link
Contributor Author

ndf commented Nov 29, 2015

Whats in it:

  • a logger-service (Drupal\rules\Logger\RulesLog) that dispatches any log-item in the system as an event.
  • an event-type (Drupal\rules\Event\SystemLoggerEvent) with event_name 'rules_system_logger_event'
  • Kernel test
  • [not working] Integration test

Plz have discussions about the logger-event format.

Currently it is implemented the same as dblog.
This means that the event-subject looks like this:
$subject = array(
'uid' => $context['uid'],
'type' => Unicode::substr($context['channel'], 0, 64),
'message' => $message,
'variables' => serialize($message_placeholders),
'severity' => $level,
'link' => $context['link'],
'location' => $context['request_uri'],
'referer' => $context['referer'],
'hostname' => Unicode::substr($context['ip'], 0, 128),
'timestamp' => $context['timestamp'],
);
Tests for this format are not written yet.

use RfcLoggerTrait;

/**
* An EventDispatcherInterface instance.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add var docs for the data type?

$this->logger = $this->container->get('logger.channel.rules');

// Creates a logger-item, that must be dispatched as event.
\Drupal::logger('rules_test')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use $this->container->get('logger.factory')->get('rules_test');

@ndf ndf mentioned this pull request Dec 3, 2015
@klausi
Copy link
Collaborator

klausi commented Dec 3, 2015

continued in #314

@klausi klausi closed this Dec 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants