The real power of this system is the ability to trigger events and have them perform a specific notification action. Monitor Events are simple actions that accept a message/description of the error and the Monitor Task. The event will trigger the creation of a log entry for the message and notifications as needed.

By creating an event, it will be possible for developers to create EventSubscribers to the Monitor Event and add additional reactions to the event as needed.

These events should be created using Symfony.

Documentation

https://symfony.com/doc/current/components/event_dispatcher.html#events

Implementation

Every monitor event should have its own default event subscribers. These event subscribers should control the generation of logs (to be displayed as part of the status page and in email/json). Event Subscribers for notifications will be handled in optional add-on modules/configuration.

  • Events
    • SystemMonitorOkEvent
    • SystemMonitorWarningEvent
    • SystemMonitorErrorEvent
  • EventSubscribers
    • SystemMonitorLogEventSubscriber

Checklist items

  1. Create SystemMonitorOkEvent event
  2. Create SystemMonitorWarningEvent event
  3. Create SystemMonitorErrorEvent event
  4. Create SystemMonitorLogEventSubscriber
  5. Create PHP Unit Tests for Monitor Events (as needed)
  6. Create PHP functional tests for Monitor events (as needed)

Comments

merauluka created an issue. See original summary.

merauluka’s picture

Issue summary: View changes

Added checklist items.

robpowell’s picture

StatusFileSize
new4.53 KB

@merauluka, let me know what you think of this patch.

robpowell’s picture

Status: Active » Needs review
merauluka’s picture

Status: Needs review » Needs work

Hey @robpowell, I think that there is some work to be done around the naming of the events themselves (as you and I discussed in our meeting yesterday).

Please update those and the comments in your code and resubmit. Thanks!

robpowell’s picture

Assigned: robpowell » merauluka
Status: Needs work » Needs review
StatusFileSize
new4.4 KB
new2.73 KB

Made changes based off our code review.

robpowell’s picture

StatusFileSize
new4.33 KB
new4.51 KB

Updated class to MonitorEvent

merauluka’s picture

Status: Needs review » Fixed

Commited and merged. Thanks @robpowell!

merauluka’s picture

Status: Fixed » Closed (fixed)