Skip to content

Log level 2.4.0+

📝 Name: logLevel · 🖥️ Option: --log-level · 🐝 Default: error

The log level used to determine which crawling results to log.

INFO

This configuration option is only respected if the logFile configuration option is set.

Available log levels

According to PSR-3, the following log levels are available:

  • emergency
  • alert
  • critical
  • error (default; enables logging of failed crawls)
  • warning
  • notice
  • info (enables logging of successful crawls)
  • debug

Log failed crawls: error

By default, only failed crawls are logged. You can explicitly configure this by setting the log level to error.

bash
./cache-warmup.phar --log-level error
json
{
    "logLevel": "error"
}
php
use EliasHaeussler\CacheWarmup;

return static function (CacheWarmup\Config\CacheWarmupConfig $config) {
    $config->setLogLevel(CacheWarmup\Log\LogLevel::ERROR);

    return $config;
};
yaml
logLevel: error
bash
CACHE_WARMUP_LOG_LEVEL="error"

Log all crawls: info

You can also set the log level to info to log successful crawls as well.

bash
./cache-warmup.phar --log-level info
json
{
    "logLevel": "info"
}
php
use EliasHaeussler\CacheWarmup;

return static function (CacheWarmup\Config\CacheWarmupConfig $config) {
    $config->setLogLevel(CacheWarmup\Log\LogLevel::INFO);

    return $config;
};
yaml
logLevel: info
bash
CACHE_WARMUP_LOG_LEVEL="info"

Released under the GNU General Public License 3.0 (or later)