Download the PHP package freefri/cake-databaselog without Composer
On this page you can find all versions of the php package freefri/cake-databaselog. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download freefri/cake-databaselog
More information about freefri/cake-databaselog
Files in freefri/cake-databaselog
Package cake-databaselog
Short Description Storing CakePHP log into database.
License MIT
Homepage https://github.com/freefri/cake-databaselog
Informations about the package cake-databaselog
cake-databaseLog
Simple storing CakePHP 2.x log into a database.
This package does not automatically update in packagist.org
Installation
Add "freefri/cake-databaselog": "dev-master",
to your composer.json or clone the repository into Plugin/CakeDatabaselog
Load the plugin in your bootstrap.php CakePlugin::load('CakeDatabaselog');
Create a table in your database kind of this:
CREATE TABLE `log_entries` (
`id` bigint(11) unsigned NOT NULL AUTO_INCREMENT,
`type` varchar(50) DEFAULT NULL,
`title` varchar(30) DEFAULT NULL,
`message` text,
`environment` varchar(100) DEFAULT NULL,
`server` text,
`created` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8;
Use the new engine to log in bootstrap.php
CakeLog::config(
'debug', [
'engine' => 'CakeDatabaselog.DatabaseLog',
'types' => ['notice', 'info', 'debug'],
'environment' => 'production-server',
]
);
Related projects
You may also be interested in a more complex solution: https://github.com/dereuromark/CakePHP-DatabaseLog (those two projects are not related)