Controller/Adminhtml/Connector/Ajaxlogcontent.php
public function execute()
    {
        $logFile = $this->getRequest()->getParam('log');
        switch ($logFile) {
            case "connector":
                $header = 'Marketing Automation Log';
                break;
            case "system":
                $header = 'Magento System Log';
                break;
            case "exception":
                $header = 'Magento Exception Log';
                break;
            case "debug":
                $header = 'Magento Debug Log';
                break;
            default:
                $header = 'Marketing Automation Log';
        }
        $content = nl2br($this->escaper->escapeHtml($this->file->getLogFileContent($logFile)));
        $response = [
            'content' => $content,
            'header' => $header
        ];
        $this->getResponse()->representJson($this->jsonHelper->jsonEncode($response));
    }
public function execute()
    {
        $logFile = $this->getRequest()->getParam('log');
        switch ($logFile) {
            case "connector":
                $header = 'Marketing Automation Log';
                break;
            case "system":
                $header = 'Magento System Log';
                break;
            case "exception":
                $header = 'Magento Exception Log';
                break;
            case "debug":
                $header = 'Magento Debug Log';
                break;
            default:
                $header = 'Marketing Automation Log';
        }
        $content = nl2br($this->escaper->escapeHtml($this->file->getLogFileContent($logFile)));
        $response = [
            'content' => $content,
            'header' => $header
        ];
        $this->getResponse()->representJson($this->jsonHelper->jsonEncode($response));
    }
public function execute ( ) { $ logFile = $ this -> getRequest ( ) -> getParam ( 'log' ) ; switch ( $ logFile ) { case "connector" : $ header = 'Marketing Automation Log' ; break ; case "system" : $ header = 'Magento System Log' ; break ; case "exception" : $ header = 'Magento Exception Log' ; break ; case "debug" : $ header = 'Magento Debug Log' ; break ; default : $ header = 'Marketing Automation Log' ; } $ content = nl2br ( $ this -> escaper -> escapeHtml ( $ this -> file -> getLogFileContent ( $ logFile ) ) ) ; $ response = [ 'content' => $ content , 'header' => $ header ] ; $ this -> getResponse ( ) -> representJson ( $ this -> jsonHelper -> jsonEncode ( $ response ) ) ; }
Ajax get log file content.

@return null
Ajax get log file content .