silverleague / silverstripe-logviewer

View your SilverStripe logs from inside the CMS
MIT License
10 stars 5 forks source link

Add SilverStripe config handling for which log levels should be handled #2

Closed robbieaverill closed 7 years ago

robbieaverill commented 7 years ago

The Monolog handler interface provides a handle method which you can use to filter or keep log entries passed to it.

We should be able to configure which log levels to keep for our DataObjectHandler, e.g.:

---
Name: logviewerconfig
---
SilverLeague\LogViewer\Handler\DataObjectHandler:
  handle_log_levels: [ INFO, WARN, ERROR ]

Alternatively, perhaps we put this along with some other settings e.g. maximum log entry limit, max lifetime before cleanup, etc into a SiteConfig area instead of config? I'd probably say we keep the UI clean and put it all in YAML.