Guest User

Untitled

a guest
Dec 16th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.50 KB | None | 0 0
  1. <?php
  2. App::uses('CakeLogInterface', 'Log');
  3. App::import("Model", "LogEntry");
  4.  
  5. class DatabaseLogger implements CakeLogInterface {
  6.     public function __construct($options = array()) {
  7.         // ...
  8.     }
  9.  
  10.     public function write($type="info", $message, $sirues = null, $report_id = null ) {
  11.         $logEntry = array(
  12.                 'type' => $type,
  13.                 'message' => $message,
  14.                 'sirues' => $sirues,
  15.                 'report_id' => $report_id
  16.                 );
  17.         $entry = new LogEntry();
  18.         $entry->save($logEntry);
  19.         // write to the database.
  20.     }
  21. }
Add Comment
Please, Sign In to add comment