Wednesday, April 29, 2015

Cakephp 3 LoggerPlugin

Hi 

I wanted to create a plugin to manage the logs in the database. However, the whole thing will not work.^
What I have done:

  1. Bake a plugin (bin/cake bake plugin DatabaseLogger)
  2. Create the folder Log and Log/Engine in the Folder src and the php-File DatabaseLog in Log/Engine
DatapaseLog.php:
<?php

namespace DatabaseLog\Log\Engine;

use Cake\Log\Engine\BaseLog;

class DatabaseLog extends BaseLog{

    private $Model;

    public function __construct(array $config = []){
        parent::__construct($config);
    }

    public function log($level, $message, array $context = []){
        //.. Code
    }
}

my bootstrap.php
Plugin::load('DatabaseLogger', ['autoload' => true]);

my app.php
 'Log' => [
        'debug' => [
            'className' => 'DatabaseLogger.DatabaseLog'
        ]
      ],

when I open the application, I get the following error message: Could Not load class DatabaseLog

Why is the class does not load?

Thanks, Patrick

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

No comments: