Skip to content

Commit

Permalink
Merge branch 'master' into security/username
Browse files Browse the repository at this point in the history
  • Loading branch information
DawoudIO authored Feb 3, 2025
2 parents ed1d9aa + 0335534 commit e995067
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/ChurchCRM/utils/LoggerUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ public static function getLogLevel(): int
return intval(SystemConfig::getValue('sLogLevel'));
}

public static function isDebugLogLevel(): bool
{
return SystemConfig::getValue('sLogLevel') == Logger::DEBUG;
}

public static function buildLogFilePath(string $type): string
{
return SystemURLs::getDocumentRoot() . '/logs/' . date('Y-m-d') . '-' . $type . '.log';
Expand Down
2 changes: 1 addition & 1 deletion src/Include/slim/error-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
ini_set('log_errors', true);
ini_set('error_log', LoggerUtils::buildLogFilePath('slim'));

$errorMiddleware = $app->addErrorMiddleware(true, true, true, LoggerUtils::getSlimMVCLogger());
$errorMiddleware = $app->addErrorMiddleware(LoggerUtils::isDebugLogLevel(), true, true, LoggerUtils::getSlimMVCLogger());
// Get the default error handler and register my custom error renderer.
$errorHandler = $errorMiddleware->getDefaultErrorHandler();

Expand Down

0 comments on commit e995067

Please sign in to comment.