Log Levels

Heads Up! Use the \Yee\Log constants when setting the log level instead of using raw integers.

The Yee application’s log object will respect or ignore logged messages based on its log level setting. When you invoke the log objects’s methods, you are inherently assigning a level to the logged message. The available log levels are:

\Yee\Log::EMERGENCY : Level 1

\Yee\Log::ALERT : Level 2

\Yee\Log::CRITICAL : Level 3

\Yee\Log::ERROR : Level 4

\Yee\Log::WARN : Level 5

\Yee\Log::NOTICE : Level 6

\Yee\Log::INFO : Level 7

\Yee\Log::DEBUG : Level 8

Only messages that have a level less than the current log object’s level will be logged. For example, if the log object’s level is \Yee\Log::WARN (5), the log object will ignore \Yee\Log::DEBUG and \Yee\Log::INFO messages but will accept \Yee\Log::WARN, \Yee\Log::ERROR, and \Yee\Log::CRITICAL messages.

How to set the log level

<?php
$app->log->setLevel(\Yee\Log::WARN);

You can set the log object’s level during application instantiation, too:

<?php
$app = new \Yee\Yee(array(
    'log.level' => \Yee\Log::WARN
));