Log (class)

Class Log

Logs messages to configured Log adapters. One or more adapters can be configured using Cake Logs's methods. If you don't configure any adapters, and write to Log, the messages will be ignored.

Configuring Log adapters

You can configure log adapters in your applications config/app.php file. A sample configuration would look like:

Log::config('my_log', ['className' => 'FileLog']);

You can define the className as any fully namespaced classname or use a short hand classname to use loggers in the App\Log\Engine & Cake\Log\Engine namespaces. You can also use plugin short hand to use logging classes provided by plugins.

Log adapters are required to implement Psr\Log\LoggerInterface, and there is a built-in base class (Cake\L