Skip to content

majna/EmailLog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Email Storage stream for Logging

Send log by email using one of configured EmailConfig in app/Config/email.php

Usage

Add to app bootstrap:

<?php
CakePlugin::load('EmailLog');
App::uses('CakeLog', 'Log');
CakeLog::config('email', array(
	'engine' => 'EmailLog.EmailLog', 
	'emailConfig' => 'default', // optional
	'subjectFormat' => ':type  :date  @ :host', // optional
	'logTypes' => array('info', 'notice', 'warrning', 'debug', 'error')  // optional
));

Cake will autoconfigure file log, but only if there's no already configured handlers. So append file config too:

CakeLog::config('file', array('engine' => 'FileLog'));

Test it now in controller:

CakeLog::write('error', 'Missing key: '. print_r($this->request, true));

Requirements

PHP version: PHP 5.2+
CakePHP version: 2.x

About

Email storage stream for Logging on CakePHP 2.x

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages