I would like to know the below 2 locations of Magento 1 in Magento 2. Where can I find these 2 locations in Magento 2 Admin Panel ?

First location

enter image description here

Second location

enter image description here


Unfortunately, those options are gone now in Magento.

Regarding the visitor log, everything is logged via the \Magento\Customer\Model\Logger model and via events observers declared under \Magento\Customer\etc\frontend\events.xml.

However, the automatic cleaning seems to be totally gone.

Regarding the system and exceptions logs, same issue, it's not configurable via the backend anymore and it's hardcoded directly in the following classes:

  • \Magento\Framework\Logger\Handler\Debug.php when you use the debug level, logs will go to /var/log/debug.log
  • \Magento\Framework\Logger\Handler\Exception.php when you use the exception level, logs will go to /var/log/exception.log
  • \Magento\Framework\Logger\Handler\System.php when you use the system level, logs will got to /var/log/system.log

If you want to log your variables you can do this way.

namespace Test\Testpayment\Observer;

class Sendtogateway implements \Magento\Framework\Event\ObserverInterface
  protected $_responseFactory;
  protected $_url;
  protected $order;
  protected $logger;
  protected $_checkoutSession;

    public function __construct(
        \Magento\Framework\App\ResponseFactory $responseFactory,
    \Magento\Framework\UrlInterface $url,
    \Magento\Sales\Api\Data\OrderInterface $order,
        \Psr\Log\LoggerInterface $loggerInterface,
    \Magento\Checkout\Model\Session $checkoutSession
        $this->_responseFactory = $responseFactory;
    $this->_url = $url;
    $this->order = $order;
        $this->logger = $loggerInterface;
    $this->_checkoutSession = $checkoutSession;

  public function execute(\Magento\Framework\Event\Observer $observer)

     $id = $observer->getEvent()->getOrder()->getIncrementId();
     $orderdetail = $this->order->loadByIncrementId($id);
     $customerBeforeAuthUrl = $this->_url->getUrl('testpay/index/index/');
  • This answer not belong to the question
    – Asish Hira
    Nov 3 '18 at 4:22
  • It is not the correct way. Oct 18 '19 at 6:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.