// We now are in the new worker
DBA::connect();
- /// @todo Reinitialize the logger to set a new process_id and uid
+ DI::flushLogger();
$process = DI::process()->create($pid);
$cycles = 0;
// "LoggerInterface" instances
//
+ /**
+ * Flushes the Logger instance, so the factory is called again
+ * (creates a new id and retrieves the current PID)
+ */
+ public static function flushLogger()
+ {
+ $flushDice = self::$dice
+ ->addRule(LoggerInterface::class, self::$dice->getRule(LoggerInterface::class))
+ ->addRule('$devLogger', self::$dice->getRule('$devLogger'));
+ static::init($flushDice);
+ }
+
/**
* @return LoggerInterface
*/
use Friendica\Core\PConfig;
use Friendica\Core\L10n;
use Friendica\Core\Lock;
-use Friendica\Core\Process;
use Friendica\Core\Session\Capability\IHandleSessions;
use Friendica\Core\Storage\Repository\StorageManager;
use Friendica\Database\Database;