A logger that logs via email and is compatible with PSR-3

1.0.0 2023-04-25 16:37 UTC

This package is auto-updated.

Last update: 2024-05-25 19:02:12 UTC


A PSR-3 logger for PHP that sends logs via email.


composer require programster/email-logger

Example Usage

# Create an emailer, in this case using PHPMailer.
# Any emailer that implements the EmailerInterface will work
$emailer = new Programster\Emailers\PhpMailerEmailer(
    "Senders Name",

# Create the email logger
$logger = new EmailLogger(
    new EmailSubscriber("Jenn", ""),
    new EmailSubscriber("Roy", ""),

# Create some useful context for the log that might help debugging/resolving what went wrong...
$context = [
    'some' => 'details'

# Send the log (email)
$logger->critical("There was a critical error!", $context);


When developing this package, please be sure to test, even if it's very basic. For now, one can test by removing the .example extension from the settings.php.example file, and filling it in. Then execute the main.php script to send emails to the subscribers specified in your settings.