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

The Slim 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:

Level 1
Level 2
Level 3
Level 4
Level 5
Level 6
Level 7
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 \Slim\Log::WARN (5), the log object will ignore \Slim\Log::DEBUG and \Slim\Log::INFO messages but will accept \Slim\Log::WARN, \Slim\Log::ERROR, and \Slim\Log::CRITICAL messages.

How to set the log level


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

$app = new \Slim\Slim(array(
    'log.level' => \Slim\Log::WARN