private function setupLogging() : void
{
if ($this->get('debug')) {
Log::addLogger(['logger' => 'inmemory']);
}
if ($this->get('log_deprecated')) {
Log::addLogger(['text_file' => 'deprecated.php'], Log::ALL, ['deprecated']);
}
$logLevels = Log::ERROR | Log::CRITICAL | Log::ALERT | Log::EMERGENCY;
if ($this->get('debug')) {
$logLevels = Log::ALL;
}
Log::addLogger(['text_file' => 'joomla_core_errors.php'], $logLevels, ['system']);
if ($this->get('log_everything')) {
Log::addLogger(['text_file' => 'everything.php'], Log::ALL, ['deprecated', 'deprecation-notes', 'databasequery'], true);
}
if ($this->get('log_categories')) {
$priority = 0;
foreach ($this->get('log_priorities', ['all']) as $p) {
$const = '\\Joomla\\CMS\\Log\\Log::' . strtoupper($p);
if (defined($const)) {
$priority |= constant($const);
}
}
$categories = preg_split('/[^\\w.-]+/', $this->get('log_categories', ''), -1, PREG_SPLIT_NO_EMPTY);
$mode = (bool) $this->get('log_category_mode', false);
if (!$categories) {
return;
}
Log::addLogger(['text_file' => 'custom-logging.php'], $priority, $categories, $mode);
}
}