code: public function rotateLogs()
  	{
  		@trigger_error('Using Automator::rotateLogs() has been deprecated and will no longer work in Contao 5.0. Use the logger service instead, which rotates its log files automatically.', E_USER_DEPRECATED);
  
  		$rootDir = System::getContainer()->getParameter('kernel.project_dir');
  		$arrFiles = preg_grep('/\.log$/', scan($rootDir . '/system/logs'));
  
  		foreach ($arrFiles as $strFile)
  		{
  			$objFile = new File('system/logs/' . $strFile . '.9');
  
  			// Delete the oldest file
  			if ($objFile->exists())
  			{
  				$objFile->delete();
  			}
  
  			// Rotate the files (e.g. error.log.4 becomes error.log.5)
  			for ($i=8; $i>0; $i--)
  			{
  				$strGzName = 'system/logs/' . $strFile . '.' . $i;
  
  				if (file_exists($rootDir . '/' . $strGzName))
  				{
  					$objFile = new File($strGzName);
  					$objFile->renameTo('system/logs/' . $strFile . '.' . ($i+1));
  				}
  			}
  
  			// Add .1 to the latest file
  			$objFile = new File('system/logs/' . $strFile);
  			$objFile->renameTo('system/logs/' . $strFile . '.1');
  		}
  	}
docs: Rotate the log files
  
  @deprecated Deprecated since Contao 4.0, to be removed in Contao 5.0.
  Use the logger service instead, which rotates its log files automatically.