Magento Logs: A Better Way To Understand Your Application And Take Better Decisions

Magento Logs: A Better Way To Understand Your Application And Take Better Decisions
  1. How to View Magento 2 Logs
    1. Understanding Magento Log
    2. View Magento Logs
  2. Types Of Magento Logs and How to Study them
    1. Magento PHP Logs
    2. Magento Apache Logs
    3. Magento NGINX Logs
  3. Improve Store Performance with Magento Store Logs
  4. Magento Log Monitoring Through Cloudways
    1. Magento PHP Logs
    2. Magento Apache Logs
    3. Magento NGINX Logs
    4. Magento Apache Error Logs
  5. Conclusion

How to View Magento 2 Logs

Magento logs are really helpful in terms of troubleshooting the problems related to Magento commerce, as these Magento logs maintain all the records of Magento activity. But before getting into the details of the Magento logs, let’s first see what these Magento 2 logs are and the flow of information in these logs.

Understanding Magento Log

Let’s start with how the process works.

When a visitor generates a request, it is initially handled by the server (Apache), which communicates to the app (Magento/PHP). Magento then sends the query to the database (MySQL). During this flow, there are chances that error might occur. In such cases, the Magento log maintains a complete log of all the activities which help in error identification and resolution.

By default, Magento does not send error & exceptions messages and thus developers do not get notified if anything happens. Magento maintains a log of all errors in the Magento 2 error log. I recommended that developers and store owners continuously check Magento 2 logs and take timely action before the damage gets done.

View Magento Logs

  • Log Directories: By default, all Magento logs are maintained in var/log directory which can be accessed via SSH/CLI or through FTP

Via FTP structure

/applications/[application folder]/public_html/var/log

To view a specific log, download it on a local drive.

Via CLI

Use the following command to access the Magento 2 log file:

cd public_html/var/log

Via CLI Magento Logs

Once in the folder, use the following command to view the Magento log file:

ls -l 

Magento Logs: A Better Way To Understand Your Application And Take Better Decisions 1

[…]

 



This article was written by Syed Muneeb Ul Hasan and originally published on The Official Cloudways Blog.

Disclosure: Some of the links in this post are "affiliate links." This means if you click on the link and purchase the product, We may receive an affiliate commission.

Leave a Comment

You have to agree to the comment policy.

Show Your ❤️ Love! Like Us
Scroll to Top