Simple Logger plugin for Craft CMS

Plugin for collecting exception handlers logs and reporting over email.

A simple solution for those who can't or won't pay for corporate solution loggers like: New Relic, Dynatrace, Datadog and others.

Install

composer require leowebguy/simple-logger && php craft plugin/install simple-logger

Usage

Set these two .env parameters to make sure Simple Logger is active

# Simple Logger
LOGGER_ON=1
LOGGER_EMAIL=john@email.com

LOGGER_EMAIL accept multiple emails LOGGER_EMAIL=john@email.com,jane@@email.com

The plugin will use the built-in craft event EVENT_BEFORE_HANDLE_EXCEPTION to handle exceptions, saving into a custom log file storage/logs/simplelogger.json

[
    {
        "time": "2023-01-21 17:37:21",
        "sourcetype": "Exception 400",
        "level_name": "ERROR",
        "message": "TwigErrorRuntimeError: Calling unknown method: craftwebtwigvariablesCraftVariable::deviceDetect1() in /var/www/html/templates/index.twig:10"
    }
]

Using the same event above, Simple Logger will once a day (after 8pm) collect the report and send an email to LOGGER_EMAIL defined recipient

report

Simple Logger won't collect NotFoundHttpException exceptions, mostly related to inexistent pages or resources

Did we miss something?

PR into https://github.com/leowebguy/simple-logger

Installation Instructions

To install this plugin, copy the command above to your terminal.

Active Installs
20
Version
1.0.2
License
MIT
Compatibility
Craft 4, Craft 5
Last release
March 24, 2023
Activity (30 days)
0
Closed Issues
0
Open Issues
0
Merged PRs
0
Open PRs