Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- App::uses('CakeLogInterface', 'Log');
- App::import("Model", "LogEntry");
- class DatabaseLogger implements CakeLogInterface {
- public function __construct($options = array()) {
- // ...
- }
- public function write($type="info", $message, $sirues = null, $report_id = null ) {
- $logEntry = array(
- 'type' => $type,
- 'message' => $message,
- 'sirues' => $sirues,
- 'report_id' => $report_id
- );
- $entry = new LogEntry();
- $entry->save($logEntry);
- // write to the database.
- }
- }
Add Comment
Please, Sign In to add comment