Log the notification contents

@return void
438711
protected function logNotificationContents()
    {
        $this->ipnLogFile->writeLine("Refund Notification @ ".date("Y-m-d H:i:s") . " (GMT)");
        $this->ipnLogFile->writeLine("=============================================================================");
        if ($this->notification->isSetRefundDetails()) {
            $this->ipnLogFile->writeLine("  RefundDetails");
            $refundDetails = $this->notification->getRefundDetails();
            if ($refundDetails->isSetAmazonRefundId()) {
                $this->ipnLogFile->writeLine("      AmazonRefundId");
                $this->ipnLogFile->writeLine("          " . $refundDetails->getAmazonRefundId());
            }
            if ($refundDetails->isSetRefundReferenceId()) {
                $this->ipnLogFile->writeLine("  RefundReferenceId");
                $this->ipnLogFile->writeLine("      " . $refundDetails->getRefundReferenceId());
            }
            if ($refundDetails->isSetRefundType()) {
                $this->ipnLogFile->writeLine("  RefundType");
                $this->ipnLogFile->writeLine("      " . $refundDetails->getRefundType());
            }
            if ($refundDetails->isSetRefundAmount()) {
                $this->ipnLogFile->writeLine("  RefundAmount");
                $refundAmount = $refundDetails->getRefundAmount();
                if ($refundAmount->isSetAmount()) {
                    $this->ipnLogFile->writeLine("      Amount");
                    $this->ipnLogFile->writeLine("          " . $refundAmount->getAmount());
                }
                if ($refundAmount->isSetCurrencyCode()) {
                    $this->ipnLogFile->writeLine("      CurrencyCode");
                    $this->ipnLogFile->writeLine("          " . $refundAmount->getCurrencyCode());
                }
            }
            if ($refundDetails->isSetFeeRefunded()) {
                $this->ipnLogFile->writeLine("  FeeRefunded");
                $feeRefunded = $refundDetails->getFeeRefunded();
                if ($feeRefunded->isSetAmount()) {
                    $this->ipnLogFile->writeLine("      Amount");
                    $this->ipnLogFile->writeLine("          " . $feeRefunded->getAmount());
                }
                if ($feeRefunded->isSetCurrencyCode()) {
                    $this->ipnLogFile->writeLine("      CurrencyCode");
                    $this->ipnLogFile->writeLine("          " . $feeRefunded->getCurrencyCode());
                }
            }
            if ($refundDetails->isSetCreationTimestamp()) {
                $this->ipnLogFile->writeLine("  CreationTimestamp");
                $this->ipnLogFile->writeLine("      " . $refundDetails->getCreationTimestamp());
            }
            if ($refundDetails->isSetRefundStatus()) {
                $this->ipnLogFile->writeLine("  RefundStatus");
                $refundStatus = $refundDetails->getRefundStatus();
                if ($refundStatus->isSetState()) {
                    $this->ipnLogFile->writeLine("      State");
                    $this->ipnLogFile->writeLine("          " . $refundStatus->getState());
                } 
                if ($refundStatus->isSetLastUpdateTimestamp()) {
                    $this->ipnLogFile->writeLine("      LastUpdateTimestamp");
                    $this->ipnLogFile->writeLine("          " . $refundStatus->getLastUpdateTimestamp());
                }
                if ($refundStatus->isSetReasonCode()) {
                    $this->ipnLogFile->writeLine("      ReasonCode");
                    $this->ipnLogFile->writeLine("          " . $refundStatus->getReasonCode());
                }
                if ($refundStatus->isSetReasonDescription()) {
                    $this->ipnLogFile->writeLine("      ReasonDescription");
                    $this->ipnLogFile->writeLine("          " . $refundStatus->getReasonDescription());
                }
            }
            if ($refundDetails->isSetSoftDescriptor()) {
                $this->ipnLogFile->writeLine("  SoftDescriptor");
                $this->ipnLogFile->writeLine("      " . $refundDetails->getSoftDescriptor());
            }
        }
    }
748481
protected function _log($contents, $log) {
		$config = [
			'level' => LOG_DEBUG,
			'scope' => 'email',
		];
		if ($log !== true) {
			if (!is_array($log)) {
				$log = ['level' => $log];
			}
			$config = array_merge($config, $log);
		}

		Log::write(
			$config['level'],
			PHP_EOL . $contents['headers'] . PHP_EOL . $contents['message'],
			$config['scope']
		);
	}
33544
public function log()
    {
        $result = [];
        if ($this->hasRequestParameter('messages')) {
            $messages = json_decode($this->getRawParameter('messages'), true);
            foreach ($messages as $message) {
                \common_Logger::singleton()->log($this->getLevel($message['level']), json_encode($message), ['frontend']);
            }
        }
        $this->returnJson($result);
    }
224732
public function logs() {
		$this->out('Deleting logs:');
		if (!empty($this->args)) {
			foreach ($this->args as $arg) {
				if (!is_dir(LOGS . $arg)) {
					$this->err('No log dir \'' . $arg . '\'');
					continue;
				}
				$this->out('\'' . $arg . '\' emptied');
				$this->_empty(LOGS . $arg);
			}
		} else {
			$this->_empty(LOGS);
			$this->out('All log files deleted');
		}
	}
338554
public function register()
    {
        $this->bindContracts();
        $this->app->singleton('notifications.contents', function () {
            return new Contents();
        });
        $this->commands([
            NotificationCategoriesCommand::class,
            NotificationSeveritiesCommand::class,
            NotificationTypesCommand::class,
            NotificationsRemover::class,
        ]);
    }
541466
public function log(): void
    {
        if (file_exists(FLOW_PATH_DATA . 'Logs/Elasticsearch') && is_dir(FLOW_PATH_DATA . 'Logs/Elasticsearch') && is_writable(FLOW_PATH_DATA . 'Logs/Elasticsearch')) {
            file_put_contents($this->filename, $this->renderErrors());
            $this->logger->log($this->message, LOG_ERR, [], 'Flowpack.ElasticSearch.ContentRepositoryAdaptor', __CLASS__, __FUNCTION__);
        } else {
            $this->logger->log(sprintf('Could not write indexing errors backtrace into %s because the directory could not be created or is not writable.', FLOW_PATH_DATA . 'Logs/Elasticsearch/'), LOG_WARNING, [], 'Flowpack.ElasticSearch.ContentRepositoryAdaptor', __CLASS__, __FUNCTION__);
        }
    }
437978
public function log($message): void
	{
		$defaults = [
			'SEVERITY' => 'INFO',
			'AUDIT_TYPE_ID' => $this->auditTypeId,
			'ITEM_ID' => $this->itemId ?: '',
		];

		$message = $this->logMessToArray($message);

		CEventLog::Add(array_merge($defaults, $message, ['MODULE_ID' => $this->moduleId]));
	}
411848
private function logRecentEvents()
    {
        $events = $this->getService()
            ->describeStackEvents([
                'StackName' => $this->getName()
            ]);
        $events = array_column(array_reverse($events['StackEvents']), null, 'EventId');

        foreach(array_diff_assoc($events, $this->events) as $event) {

            $timestamp = $event['Timestamp'];

            if ($timestamp < $this->datetimeTaskStart) {
                continue;
            }

            $this->log($timestamp . ': '
                . $event['ResourceType'] . ' > ' . $event['LogicalResourceId']
                . ' (' . $event['ResourceStatus'] . ')'
            );

            if ($event['ResourceStatusReason']) {
                $this->log($event['ResourceStatusReason']);
            }
        }

        $this->events = $events;
    }
716443
protected function log()
	{
		if ( class_exists( 'CCLog' ) )
		{
			try {
				\CCLog::add( 
					$this->inspector->exception()->getMessage()." - ".
					str_replace( CCROOT, '', $this->inspector->exception()->getFile() ).":".
					$this->inspector->exception()->getLine(), 'exception'
				);
				\CCLog::write();
			} catch( \Exception $e ) {}
		}
	}
892805
public function log($message)
    {
        $formattedMessage = $this->formatMessage($message);
        if (!empty($formattedMessage)) {
            $this->logger->info($formattedMessage);
        }
    }
878476
protected function log(Args $args)
    {
        $message = sprintf("%s%s", $this->render($args), PHP_EOL);
        file_put_contents($this->getStream(), $message);
    }
646667
protected function _reportSuiteMessages($log)
    {
        $this->_indent = 0;
        $messages = array_values(array_filter($log->messages()));
        array_pop($messages);
        foreach ($messages as $message) {
            $this->write($message);
            $this->write("\n");
            $this->_indent++;
        }
    }
799200
public function logSuccess()
  {
    $this->_lastSuccess = true;
    if ($this->_debug) {
      printf("[LoadBalancer] Success for %s<br />\n", $this->_connectionStrings[$this->_lastReturnedIndex] . (isset($this->_storageNames[$this->_lastReturnedIndex]) ? '|' . $this->_storageNames[$this->_lastReturnedIndex] : ''));
    }
    $hash = md5($this->_connectionStrings[$this->_lastReturnedIndex] . (isset($this->_storageNames[$this->_lastReturnedIndex]) ? '|' . $this->_storageNames[$this->_lastReturnedIndex] : ''));
    if (file_exists($this->_statusFilePrefix . $hash)) {
      unlink($this->_statusFilePrefix . $hash);
    }
  }
27789
public static function show_notification() {

		$current_notification = self::get_last_notification();

		$notification_details = [];
		// Check if the saved notification is still present among the possible ones.
		if ( ! empty( $current_notification ) ) {
			$notification_details = self::get_notification_details( $current_notification );
			if ( empty( $notification_details ) ) {
				$current_notification = [];
			}
		}
		// Check if the notificatin is expired.
		if ( ! empty( $current_notification ) && self::is_notification_expired( $current_notification ) ) {
			update_option( $current_notification['id'], 'no' );
			self::set_last_active_notification_timestamp();
			$current_notification = [];
		}
		// If we don't have any saved notification, get a new one.
		if ( empty( $current_notification ) ) {
			$notification_details = self::get_random_notification();
			if ( empty( $notification_details ) ) {
				return;
			}
			self::set_active_notification(
				[
					'id'         => $notification_details['id'],
					'display_at' => time(),
				]
			);
		}
		if ( empty( $notification_details ) ) {
			return;
		}
		$notification_html = self::get_notification_html( $notification_details );
		do_action( $notification_details['id'] . '_before_render' );

		echo $notification_html;

		do_action( $notification_details['id'] . '_after_render' );
		self::render_snippets();
	}
804352
public function showLogView()
    {
        $this->subMenu['log']['active'] = true;

        $log = Log::getLogger();

        $logContents = '';

        collect($log->getHandlers())->reject(function ($handler) {
            return $handler instanceof SyslogHandler;
        })->each(function ($handler) use (&$logContents, $log) {
            if (file_exists($path = $log->getHandlers()[0]->getUrl())) {
                $logContents = file_get_contents($path);
            }
        });

        return View::make('dashboard.settings.log')->withLog($logContents)->withSubMenu($this->subMenu);
    }
637176
public function log()
    {
        if (!$this->output) { return $this; }

        foreach (func_get_args() as $line) {

            if (is_array($line)) {
                call_user_func_array([ $this->output, 'write' ], $line);
                continue;
            }

            $this->output->write($line);
        };

        return $this;
    }
47751
public function setDebugLog()
	{
		$logConsole  = \Log::singleton( 'console', '', 'console',
			array(
				'lineFormat' => '%{timestamp} [%{priority}] %{message}',
				'timeFormat' => '%Y-%m-%d %H:%M:%S',
			)
		);

		$logError = \Log::singleton( 'error_log', PEAR_LOG_TYPE_SYSTEM, 'error_log',
			array(
				'lineFormat' => '[%{priority}] %{message}',
			)
		);

		$logComposite = Log::singleton( 'composite' );
		$logComposite->addChild( $logConsole );
		$logComposite->addChild( $logError );

		$this->setLog( $logComposite );
	}