dev-master
9999999-devDatabase log writer for Kohana 3.3
The Requires
- php >=5.3.0
- kohana/core >=3.3
- kohana/database *
by Nick Zahn
database log logging kohana
Wallogit.com
2017 © Pedro Peláez
Database log writer for Kohana 3.3
A database log writer for Kohana 3., (*1)
This is a first version which works in Kohana 3.3. In the future there might be a more beautiful rendering of array data and maybe an easier installation. But for now it does its job., (*2)
You may add this module manually as a Git submodule to your Kohana project's modules directory or if you're using Composer, add this requirement to your composer.json file:, (*3)
{
"require": {
"manc/kohana-log-database": "dev-master"
}
}
Then add the module in your bootstrap.php – and also make sure the database module is added (and configured). Example:, (*4)
Kohana::modules(array(
'database' => MODPATH.'database',
'logdb' => MODPATH.'kohana-log-database',
));
Manually add the required table to your database. You will find the structure in the file logs-schema-mysql.sql. Your database must be configured in Kohana with the database module., (*5)
By default Kohana's bootstrap.php contains this line:, (*6)
Kohana::$log->attach(new Log_File(APPPATH.'logs'));
You can remove or comment it out if you no longer need it. To enable the database log writer add the following line after loading the module via Kohana::modules():, (*7)
Kohana::$log->attach(new Log_Database('logs'));
The parameter of the constructor of class Log_Database represents the table name used for logging., (*8)
Database log writer for Kohana 3.3
database log logging kohana