Skip to content

Commit 6bcc966

Browse files
committed
update package config
1 parent a4e0169 commit 6bcc966

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/Config/PackageConfig.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ final class PackageConfig extends AbstractConfig implements ConfigInterface
2222
private function __construct(string $secretKey, string $publicKey, string $encryptKey, string $env)
2323
{
2424
parent::__construct($secretKey, $publicKey, $encryptKey, $env);
25-
$this->logger->pushHandler(new RotatingFileHandler(__DIR__ . "../../../../../../" . self::LOG_FILE_NAME, 90));
2625
}
2726

2827
public static function setUp(string $secretKey, string $publicKey, string $enc, string $env, ?LoggerInterface $customLogger = null): ConfigInterface
@@ -32,9 +31,12 @@ public static function setUp(string $secretKey, string $publicKey, string $enc,
3231
if ($customLogger) {
3332
$instance->logger = $customLogger;
3433
} else {
35-
$rootPath = __DIR__ . '/../../../../../../';
36-
$logDir = $rootPath . $_ENV['FLW_LOG_DIR'] ?? 'logs';
37-
34+
$vendorPath = dirname(__DIR__, 4);
35+
$rootPath = dirname($vendorPath);
36+
37+
$logSubDir = $_ENV['FLW_LOG_DIR'] ?? 'logs';
38+
$logDir = $rootPath . DIRECTORY_SEPARATOR . $logSubDir;
39+
3840
if (!is_dir($logDir)) {
3941
if (!mkdir($logDir, 0775, true) && !is_dir($logDir)) {
4042
throw new \RuntimeException("Flutterwave: Failed to create log directory at $logDir");

0 commit comments

Comments
 (0)