src/Exception/ErrorHandler.php
/**
	 * Logs the specified error. This is only called if logging is enabled in the errors configuration file.
	 *
	 * @param HorizonError $error
	 * @return void
	 */
Logs the specified error. This is only called if logging is enabled in the errors configuration file.
@param HorizonError $error
@return void
Logs the specified error . This is only called if logging is enabled in the errors configuration file . @param HorizonError $error @return void
public function log(HorizonError $error) {
		$logFile = ini_get('error_log');
		$logDir = dirname($logFile);
		if (!file_exists($logDir)) {
			return;
		}
		if ((file_exists($logFile) && !is_writable($logFile)) || (!file_exists($logFile) && !is_writable($logDir))) {
			return;
		}
		$timestamp = date('d-M-Y G:i:s T');
		$message = $this->formatMessage(sprintf(
			"[%s] Horizon: %s: %s in %s on line %d\r\n",
			$timestamp,
			$error->getLabel(),
			$error->getMessage(),
			$error->getFile(),
			$error->getLine()
		));
		@file_put_contents($logFile, $message, FILE_APPEND);
	}
public function log ( HorizonError $ error ) { $ logFile = ini_get ( 'error_log' ) ; $ logDir = dirname ( $ logFile ) ; if ( ! file_exists ( $ logDir ) ) { return ; } if ( ( file_exists ( $ logFile ) && ! is_writable ( $ logFile ) ) || ( ! file_exists ( $ logFile ) && ! is_writable ( $ logDir ) ) ) { return ; } $ timestamp = date ( 'd-M-Y G:i:s T' ) ; $ message = $ this -> formatMessage ( sprintf ( " [%s] Horizon: %s: %s in %s on line %d \r \n " , $ timestamp , $ error -> getLabel ( ) , $ error -> getMessage ( ) , $ error -> getFile ( ) , $ error -> getLine ( ) ) ) ; @ file_put_contents ( $ logFile , $ message , FILE_APPEND ) ; }
Logs the specified error.
Logs the specified error .
// Do not attempt to write if the file cannot be created // Do not attempt to write if we don't have permissions to the file // Generate the message // Write the log message