https://github.com/freefri/cake-databaselog
Storing CakePHP log into database
https://github.com/freefri/cake-databaselog
cake-databaselog cake-plugin cakephp cakephp-plugin cakephp2 database php
Last synced: about 1 month ago
JSON representation
Storing CakePHP log into database
- Host: GitHub
- URL: https://github.com/freefri/cake-databaselog
- Owner: freefri
- License: mit
- Created: 2014-03-17T15:51:06.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2024-03-20T15:28:03.000Z (almost 2 years ago)
- Last Synced: 2025-09-20T13:56:25.123Z (5 months ago)
- Topics: cake-databaselog, cake-plugin, cakephp, cakephp-plugin, cakephp2, database, php
- Language: PHP
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
cake-databaseLog
================
Simple storing CakePHP 2.x log into a database.
This package does **not** automatically update in [packagist.org](https://packagist.org/packages/freefri/cake-databaselog)
## 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)