Logging system in Magento 2

The logging system comes super handy in Magento development. Developers use it as a go-to tool for code debugging. There is a reduced chance of encountering a raw Magento 2 internal server error without handling it via Magento 2 logging, compared to Magento 1.

Log files show us how the store works, reveal pesky issues under the hood, and even snitch on the functions that aren’t pulling their weight. In this article, we will describe the logging system in Magento 2 and how it differs from Magento 1.

Error page customization in Magento 2

So, if you encounter a Magento 2 internal server error, it won’t appear as a white page with black textHave you ever seen a page with “There has been an error processing your request” when using Magento 1 or Magento 2? If no, you are lucky. This page is usually displayed when an issue appears in a system execution flow. Magento processes such issues by creating a separate report file in the var/report directory and by showing the error page with the details. You can also see a similar page “Service Temporarily Unavailable” when the maintenance mode has been enabled. Did you know that you can easily customize these error pages?

Magento debugging hints

If you are a web developer, there’s one thing you are doing from day to day, no matter how good you are. You can write a good code, and you may know your work like a pro, but usually you have to integrate your solutions into different systems which were, unfortunately, created by someone else. Here we meet the thing that can turn into the nightmare for you if you are following a wrong way – the debugging.

Headers already sent. How to find the reason quickly

If you look inside of your Magento system.log from time to time, you will notice an error there like the following one:

2011-01-12T14:16:52+00:00 DEBUG (7): HEADERS ALREADY SENT:

Call stack is here..

 

As you may already know, it can take a lot of time to find the place where the issues like this one appeared. So, let’s investigate why it happens and what we can do to speed up the bug fixing process.

Advices and Best Practices for Magento developers

I think everyone who is interested in ecommerce development get familiar with Magento earlier or later. It’s a very popular platform, where a lot of modern programming technologies are used. Since Magento is one of the most powerful and flexible shopping cart engines, it requires a deep level of expertise to develop extensions or even do some basic changes. So we’ve decided to share our tips for Magento Developers in this article. [Continue to Part 2]