Skip to content

Instantly share code, notes, and snippets.

@crot4lus
Last active August 29, 2015 14:15
Show Gist options
  • Save crot4lus/411dc63c17304fe65a0f to your computer and use it in GitHub Desktop.
Save crot4lus/411dc63c17304fe65a0f to your computer and use it in GitHub Desktop.
<?php
namespace App\Log\Engine;
use Cake\Log\Engine\BaseLog;
use Cake\ORM\TableRegistry;
class DataLog extends BaseLog
{
public function __construct(array $config = [])
{
}
public function log($level, $message, array $context = [])
{
$logs = TableRegistry::get('Logs');
$save_entry = $logs->save($logs->newEntity([
'message' => $message,
'user_id' => $context['user_id'],
'project_id' => $context['project_id']
]));
return $save_entry;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment