2017 © Pedro Peláez
 

library apix-log-phpmailer

A PHPMailer logger for APIx Log

image

phpmailer/apix-log-phpmailer

A PHPMailer logger for APIx Log

  • Monday, November 6, 2017
  • by phpmailer
  • Repository
  • 5 Watchers
  • 5 Stars
  • 64 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 6 Forks
  • 0 Open issues
  • 4 Versions
  • 25 % Grown

The README.md

PHPMailer logger for Apix Log

An extension for the Apix/Log PSR-3 logger that sends log messages via email using PHPMailer., (*1)

The home repo is on github, and the composer package is on packagist., (*2)

Apix Log was written by Franck Cassedanne (@frqnck). This extension is by Marcus Bointon (@Synchro) and is published via the PHPmailer organisation under the BSD license (though note that PHPMailer itself uses the LGPL)., (*3)

Installation

Install the logger via composer:, (*4)

composer require phpmailer/apix-log-phpmailer

You require at least PHP 5.5., (*5)

Usage

Create an Apix PhpMailer Log instance, providing a pre-configured PHPMailer instance to the constructor. This instance will be used for all subsequent messages., (*6)

By default the logger sends an email for each individual log message received, which can be quite inefficient, so call $logger->setDeferred(true) to save up the log messages and send them all in one message on __destruct., (*7)

We suggest you enable exceptions in your PHPMailer instance (by passing true to the constructor) otherwise you may not be told about problems sending your log messages., (*8)

Example

use PHPMailer\PHPMailer\PHPMailer;
// Create a PHPMailer instance with exceptions enabled
$mailer = new PHPMailer(true);
$mailer->addAddress('logs@example.com', 'Log Mailbox');
$mailer->setFrom('myapp@example.com', 'My App');
$mailer->isSMTP();
$mailer->SMTPAuth = true;
$mailer->Host = 'tls://mail.example.com:587';
$mailer->Username = 'user';
$mailer->Password = 'pass';
$mailer->isHTML(false);
$mailer->Subject = 'Error log';

$logger = new Apix\Logger\PhpMailer($mailer);
$logger->setDeferred(true);
$logger->info('Log me!');
$logger->error('Log me too!');

The Versions

06/11 2017

dev-master

9999999-dev

A PHPMailer logger for APIx Log

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Franck Cassedanne

04/09 2017

v2.0.0

2.0.0.0

A PHPMailer logger for APIx Log

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Franck Cassedanne

21/09 2015

v1.1.0

1.1.0.0

A PHPMailer logger for APIx Log

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Franck Cassedanne

11/09 2015

v1.0

1.0.0.0

A PHPMailer logger for Apix log

  Sources   Download

BSD-3-Clause

The Requires