]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/Logger/Type/StreamLogger.php
Merge branch '2023.03-rc' into stable
[friendica.git] / src / Core / Logger / Type / StreamLogger.php
index 2568fb4a2e469d3311eb564db036419accb035f5..d56f5b20ef6fd2b8fa001f20d9ab811597f1efea 100644 (file)
@@ -23,12 +23,12 @@ namespace Friendica\Core\Logger\Type;
 
 use Friendica\Core\Config\Capability\IManageConfigValues;
 use Friendica\Core\Hooks\Capabilities\IAmAStrategy;
+use Friendica\Core\Logger\Capabilities\IHaveCallIntrospections;
 use Friendica\Core\Logger\Exception\LoggerArgumentException;
 use Friendica\Core\Logger\Exception\LoggerException;
 use Friendica\Core\Logger\Exception\LogLevelException;
 use Friendica\Util\DateTimeFormat;
 use Friendica\Util\FileSystem;
-use Friendica\Core\Logger\Util\Introspection;
 use Psr\Log\LogLevel;
 
 /**
@@ -87,12 +87,12 @@ class StreamLogger extends AbstractLogger implements IAmAStrategy
         * @throws LoggerArgumentException
         * @throws LogLevelException
         */
-       public function __construct(string $channel, IManageConfigValues $config, Introspection $introspection, FileSystem $fileSystem, string $level = LogLevel::DEBUG)
+       public function __construct(string $channel, IManageConfigValues $config, IHaveCallIntrospections $introspection, FileSystem $fileSystem, string $level = LogLevel::DEBUG)
        {
                $this->fileSystem = $fileSystem;
 
                $stream = $this->logfile ?? $config->get('system', 'logfile');
-               if ((file_exists($stream) && !is_writable($stream)) || is_writable(basename($stream))) {
+               if ((@file_exists($stream) && !@is_writable($stream)) && !@is_writable(basename($stream))) {
                        throw new LoggerArgumentException(sprintf('%s is not a valid logfile', $stream));
                }